summaryrefslogtreecommitdiff
path: root/packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts
diff options
context:
space:
mode:
authorkeito <131662659+mst-mkt@users.noreply.github.com>2025-06-25 20:30:17 +0900
committerGitHub <noreply@github.com>2025-06-25 20:30:17 +0900
commitc424554d4a9f49560e4f3d379a93c64bdabab29e (patch)
tree009dd8a88921cd70aeb3374123da3c95dcdbba5c /packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts
parentenhance(frontend): ページネーションの並び順を逆にできるよ... (diff)
downloadmisskey-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.ts12
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.');