fix(core): Disconnect Redis after pausing queue during worker shutdown (#9928)

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Iván Ovejero
2024-07-04 18:07:47 +02:00
committed by GitHub
parent e5c324753f
commit c82579bf76
6 changed files with 15 additions and 15 deletions

View File

@@ -9,6 +9,7 @@ import {
} from 'n8n-workflow';
import { ActiveExecutions } from '@/ActiveExecutions';
import config from '@/config';
import { HIGHEST_PRIORITY, OnShutdown } from './decorators/OnShutdown';
export type JobId = Bull.JobId;
export type Job = Bull.Job<JobData>;
@@ -108,11 +109,10 @@ export class Queue {
return await this.jobQueue.client.ping();
}
async pause({
isLocal,
doNotWaitActive,
}: { isLocal?: boolean; doNotWaitActive?: boolean } = {}): Promise<void> {
return await this.jobQueue.pause(isLocal, doNotWaitActive);
@OnShutdown(HIGHEST_PRIORITY)
// Stop accepting new jobs, `doNotWaitActive` allows reporting progress
async pause(): Promise<void> {
return await this.jobQueue?.pause(true, true);
}
getBullObjectInstance(): JobQueue {