From 098563ef4ea803c2fb3596ea5f8327a98c41f7d7 Mon Sep 17 00:00:00 2001 From: izzy Date: Thu, 18 Dec 2025 14:14:24 +0000 Subject: [PATCH] refactor: use storage repository stat instead of real stat --- server/src/services/integrity.service.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server/src/services/integrity.service.ts b/server/src/services/integrity.service.ts index 09c18c2344..e2ef25fc0f 100644 --- a/server/src/services/integrity.service.ts +++ b/server/src/services/integrity.service.ts @@ -1,7 +1,6 @@ import { Injectable } from '@nestjs/common'; import { createHash } from 'node:crypto'; import { createReadStream } from 'node:fs'; -import { stat } from 'node:fs/promises'; import { basename } from 'node:path'; import { Readable, Writable } from 'node:stream'; import { pipeline } from 'node:stream/promises'; @@ -322,7 +321,8 @@ export class IntegrityService extends BaseService { const results = await Promise.all( items.map(({ reportId, path }) => - stat(path) + this.storageRepository + .stat(path) .then(() => void 0) .catch(() => reportId), ), @@ -388,7 +388,8 @@ export class IntegrityService extends BaseService { const results = await Promise.all( items.map((item) => - stat(item.path) + this.storageRepository + .stat(item.path) .then(() => ({ ...item, exists: true })) .catch(() => ({ ...item, exists: false })), ), @@ -424,7 +425,8 @@ export class IntegrityService extends BaseService { const results = await Promise.all( paths.map(({ reportId, path }) => - stat(path) + this.storageRepository + .stat(path) .then(() => reportId) .catch(() => void 0), ),