diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2025-01-11 22:43:42 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-11 13:43:42 +0000 |
| commit | c4192e81ed30292a06b85e7b00578ca87c97d076 (patch) | |
| tree | f63b8b953a37284721b4a04772c8d905126626c4 /packages/backend/src/queue/processors/CleanChartsProcessorService.ts | |
| parent | fix(frontend-embed): 型チェックエラーを修正 (#15216) (diff) | |
| download | sharkey-c4192e81ed30292a06b85e7b00578ca87c97d076.tar.gz sharkey-c4192e81ed30292a06b85e7b00578ca87c97d076.tar.bz2 sharkey-c4192e81ed30292a06b85e7b00578ca87c97d076.zip | |
enhance(backend): チャートの処理を一つずつ行うことでDBの同時接続とタイムアウトを削減 (#15239)
* sync charts one-at-a-time to reduce database contention and timeouts
* fix merge resolve failure
* Update Changelog
* update changelog
* add comments
---------
Co-authored-by: Hazelnoot <acomputerdog@gmail.com>
Diffstat (limited to 'packages/backend/src/queue/processors/CleanChartsProcessorService.ts')
| -rw-r--r-- | packages/backend/src/queue/processors/CleanChartsProcessorService.ts | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/packages/backend/src/queue/processors/CleanChartsProcessorService.ts b/packages/backend/src/queue/processors/CleanChartsProcessorService.ts index 110468801c..8c5faa8d07 100644 --- a/packages/backend/src/queue/processors/CleanChartsProcessorService.ts +++ b/packages/backend/src/queue/processors/CleanChartsProcessorService.ts @@ -48,20 +48,19 @@ 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(), - ]); + // DBへの同時接続を避けるためにPromise.allを使わずひとつずつ実行する + 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.'); } |