refactor(core): Enforce range for shutdown priority (no-changelog) (#9944)

This commit is contained in:
Iván Ovejero
2024-07-04 20:26:11 +02:00
committed by GitHub
parent c82579bf76
commit 757feaf585
6 changed files with 42 additions and 9 deletions

View File

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