summaryrefslogtreecommitdiff
path: root/packages/backend/src/queue/processors/CleanChartsProcessorService.ts
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2024-12-17 10:37:29 -0500
committerHazelnoot <acomputerdog@gmail.com>2024-12-17 10:37:29 -0500
commit0b40f2734eff04e1719dc18fcbe70f2cfc97ee76 (patch)
tree7e418dcd64963d1a5c0f65721274e8606971c916 /packages/backend/src/queue/processors/CleanChartsProcessorService.ts
parentmerge: upstream changes for 2024.11 (!742) (diff)
downloadsharkey-0b40f2734eff04e1719dc18fcbe70f2cfc97ee76.tar.gz
sharkey-0b40f2734eff04e1719dc18fcbe70f2cfc97ee76.tar.bz2
sharkey-0b40f2734eff04e1719dc18fcbe70f2cfc97ee76.zip
sync charts one-at-a-time to reduce database contention and timeouts
Diffstat (limited to 'packages/backend/src/queue/processors/CleanChartsProcessorService.ts')
-rw-r--r--packages/backend/src/queue/processors/CleanChartsProcessorService.ts26
1 files changed, 12 insertions, 14 deletions
diff --git a/packages/backend/src/queue/processors/CleanChartsProcessorService.ts b/packages/backend/src/queue/processors/CleanChartsProcessorService.ts
index 110468801c..19f98c0d51 100644
--- a/packages/backend/src/queue/processors/CleanChartsProcessorService.ts
+++ b/packages/backend/src/queue/processors/CleanChartsProcessorService.ts
@@ -48,20 +48,18 @@ export class CleanChartsProcessorService {
public async process(): Promise<void> {
this.logger.info('Clean charts...');
- await Promise.all([
- this.federationChart.clean(),
- this.notesChart.clean(),
- this.usersChart.clean(),
- this.activeUsersChart.clean(),
- this.instanceChart.clean(),
- this.perUserNotesChart.clean(),
- this.perUserPvChart.clean(),
- this.driveChart.clean(),
- this.perUserReactionsChart.clean(),
- this.perUserFollowingChart.clean(),
- this.perUserDriveChart.clean(),
- this.apRequestChart.clean(),
- ]);
+ await this.federationChart.clean();
+ await this.notesChart.clean();
+ await this.usersChart.clean();
+ await this.activeUsersChart.clean();
+ await this.instanceChart.clean();
+ await this.perUserNotesChart.clean();
+ await this.perUserPvChart.clean();
+ await this.driveChart.clean();
+ await this.perUserReactionsChart.clean();
+ await this.perUserFollowingChart.clean();
+ await this.perUserDriveChart.clean();
+ await this.apRequestChart.clean();
this.logger.succ('All charts successfully cleaned.');
}