diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2024-10-13 20:22:16 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-13 20:22:16 +0900 |
| commit | ff47fef5725ba31efc7016534c2d9db8b0ad242a (patch) | |
| tree | 8cb84a5c3fcccaf6f67d7384a86412e0368d9d99 /packages/backend/src/queue/processors/InboxProcessorService.ts | |
| parent | feat: ユーザーの名前に禁止ワードを設定できるように (#14... (diff) | |
| download | sharkey-ff47fef5725ba31efc7016534c2d9db8b0ad242a.tar.gz sharkey-ff47fef5725ba31efc7016534c2d9db8b0ad242a.tar.bz2 sharkey-ff47fef5725ba31efc7016534c2d9db8b0ad242a.zip | |
feat: リモートサーバーのサーバー情報を収集しないオプション (#14634)
* wip
* wip
* Update FetchInstanceMetadataService.ts
* Update FetchInstanceMetadataService.ts
* Update types.ts
Diffstat (limited to 'packages/backend/src/queue/processors/InboxProcessorService.ts')
| -rw-r--r-- | packages/backend/src/queue/processors/InboxProcessorService.ts | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/packages/backend/src/queue/processors/InboxProcessorService.ts b/packages/backend/src/queue/processors/InboxProcessorService.ts index a77c968395..95d764e4d8 100644 --- a/packages/backend/src/queue/processors/InboxProcessorService.ts +++ b/packages/backend/src/queue/processors/InboxProcessorService.ts @@ -192,21 +192,27 @@ export class InboxProcessorService implements OnApplicationShutdown { } } - // Update stats - this.federatedInstanceService.fetch(authUser.user.host).then(i => { + this.apRequestChart.inbox(); + this.federationChart.inbox(authUser.user.host); + + // Update instance stats + process.nextTick(async () => { + const i = await (this.meta.enableStatsForFederatedInstances + ? this.federatedInstanceService.fetchOrRegister(authUser.user.host) + : this.federatedInstanceService.fetch(authUser.user.host)); + + if (i == null) return; + this.updateInstanceQueue.enqueue(i.id, { latestRequestReceivedAt: new Date(), shouldUnsuspend: i.suspensionState === 'autoSuspendedForNotResponding', }); - this.fetchInstanceMetadataService.fetchInstanceMetadata(i); - - this.apRequestChart.inbox(); - this.federationChart.inbox(i.host); - if (this.meta.enableChartsForFederatedInstances) { this.instanceChart.requestReceived(i.host); } + + this.fetchInstanceMetadataService.fetchInstanceMetadata(i); }); // アクティビティを処理 |