make sure QueueProcessorService.dispose always completes
This commit is contained in:
parent
89981285b2
commit
e7f93f19bf
1 changed files with 9 additions and 2 deletions
|
|
@ -12,6 +12,7 @@ import type Logger from '@/logger.js';
|
|||
import { bindThis } from '@/decorators.js';
|
||||
import { CheckModeratorsActivityProcessorService } from '@/queue/processors/CheckModeratorsActivityProcessorService.js';
|
||||
import { renderFullError } from '@/misc/render-full-error.js';
|
||||
import { renderInlineError } from '@/misc/render-inline-error.js';
|
||||
import { UserWebhookDeliverProcessorService } from './processors/UserWebhookDeliverProcessorService.js';
|
||||
import { SystemWebhookDeliverProcessorService } from './processors/SystemWebhookDeliverProcessorService.js';
|
||||
import { EndedPollNotificationProcessorService } from './processors/EndedPollNotificationProcessorService.js';
|
||||
|
|
@ -596,7 +597,7 @@ export class QueueProcessorService implements OnApplicationShutdown {
|
|||
|
||||
@bindThis
|
||||
public async stop(): Promise<void> {
|
||||
await Promise.all([
|
||||
await Promise.allSettled([
|
||||
this.systemQueueWorker.close(),
|
||||
this.dbQueueWorker.close(),
|
||||
this.deliverQueueWorker.close(),
|
||||
|
|
@ -607,7 +608,13 @@ export class QueueProcessorService implements OnApplicationShutdown {
|
|||
this.objectStorageQueueWorker.close(),
|
||||
this.endedPollNotificationQueueWorker.close(),
|
||||
this.schedulerNotePostQueueWorker.close(),
|
||||
]);
|
||||
]).then(res => {
|
||||
for (const result of res) {
|
||||
if (result.status === 'rejected') {
|
||||
this.logger.error(`Error closing queue: ${renderInlineError(result.reason)}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@bindThis
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue