diff --git a/packages/job-queue-plugin/src/bullmq/bullmq-job-queue-strategy.ts b/packages/job-queue-plugin/src/bullmq/bullmq-job-queue-strategy.ts index 7685f2fcc4..721b88a469 100644 --- a/packages/job-queue-plugin/src/bullmq/bullmq-job-queue-strategy.ts +++ b/packages/job-queue-plugin/src/bullmq/bullmq-job-queue-strategy.ts @@ -84,6 +84,10 @@ export class BullMQJobQueueStrategy implements InspectableJobQueueStrategy { }).on('error', (e: any) => Logger.error(`BullMQ Scheduler error: ${e.message}`, loggerCtx, e.stack)); } + async destroy() { + await Promise.all([this.queue.close(), this.worker.close(), this.scheduler.close()]); + } + async add = {}>(job: Job): Promise> { const retries = this.options.setRetries?.(job.queueName, job) ?? job.retries; const backoff = this.options.setBackoff?.(job.queueName, job) ?? {