diff options
| author | keito <131662659+mst-mkt@users.noreply.github.com> | 2025-06-25 20:30:17 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-25 20:30:17 +0900 |
| commit | c424554d4a9f49560e4f3d379a93c64bdabab29e (patch) | |
| tree | 009dd8a88921cd70aeb3374123da3c95dcdbba5c /packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts | |
| parent | enhance(frontend): ページネーションの並び順を逆にできるよ... (diff) | |
| download | misskey-c424554d4a9f49560e4f3d379a93c64bdabab29e.tar.gz misskey-c424554d4a9f49560e4f3d379a93c64bdabab29e.tar.bz2 misskey-c424554d4a9f49560e4f3d379a93c64bdabab29e.zip | |
ジョブキューの`Progress`の値を正しく計算する (#16218)
* fix: ジョブキューのProgressの値の範囲を 0~100 に統一
* fix(backend): ジョブキューのProgressの計算に用いる総数を最初に一度だけ取得する
Diffstat (limited to 'packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts')
| -rw-r--r-- | packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts b/packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts index 728fc9e72b..782b74f0cd 100644 --- a/packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts +++ b/packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts @@ -34,6 +34,11 @@ export class CleanRemoteFilesProcessorService { let deletedCount = 0; let cursor: MiDriveFile['id'] | null = null; + const total = await this.driveFilesRepository.countBy({ + userHost: Not(IsNull()), + isLink: false, + }); + while (true) { const files = await this.driveFilesRepository.find({ where: { @@ -58,12 +63,7 @@ export class CleanRemoteFilesProcessorService { deletedCount += 8; - const total = await this.driveFilesRepository.countBy({ - userHost: Not(IsNull()), - isLink: false, - }); - - job.updateProgress(100 / total * deletedCount); + job.updateProgress(deletedCount * total / 100); } this.logger.succ('All cached remote files has been deleted.'); |