refactor: SystemWebhook/UserWebhookの配信処理呼び出し部分の改善 (#15035)

* UserWebhook側の対処

* SystemWebhook側の対処

* fix test
This commit is contained in:
おさむのひと 2025-01-14 20:14:02 +09:00 committed by GitHub
parent 5445b023e5
commit d2e22f9050
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 258 additions and 140 deletions

View file

@ -231,15 +231,10 @@ export class CheckModeratorsActivityProcessorService {
// -- SystemWebhook
const systemWebhooks = await this.systemWebhookService.fetchActiveSystemWebhooks()
.then(it => it.filter(it => it.on.includes('inactiveModeratorsWarning')));
for (const systemWebhook of systemWebhooks) {
this.systemWebhookService.enqueueSystemWebhook(
systemWebhook,
'inactiveModeratorsWarning',
{ remainingTime: remainingTime },
);
}
return this.systemWebhookService.enqueueSystemWebhook(
'inactiveModeratorsWarning',
{ remainingTime: remainingTime },
);
}
@bindThis
@ -269,15 +264,10 @@ export class CheckModeratorsActivityProcessorService {
// -- SystemWebhook
const systemWebhooks = await this.systemWebhookService.fetchActiveSystemWebhooks()
.then(it => it.filter(it => it.on.includes('inactiveModeratorsInvitationOnlyChanged')));
for (const systemWebhook of systemWebhooks) {
this.systemWebhookService.enqueueSystemWebhook(
systemWebhook,
'inactiveModeratorsInvitationOnlyChanged',
{},
);
}
return this.systemWebhookService.enqueueSystemWebhook(
'inactiveModeratorsInvitationOnlyChanged',
{},
);
}
@bindThis