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

@@ -2,6 +2,10 @@ import { Container } from 'typedi';
import { ApplicationError } from 'n8n-workflow';
import { type ServiceClass, ShutdownService } from '@/shutdown/Shutdown.service';
export const LOWEST_PRIORITY = 0;
export const DEFAULT_PRIORITY = 100;
export const HIGHEST_PRIORITY = 200;
/**
* Decorator that registers a method as a shutdown hook. The method will
* be called when the application is shutting down.
@@ -22,7 +26,7 @@ import { type ServiceClass, ShutdownService } from '@/shutdown/Shutdown.service'
* ```
*/
export const OnShutdown =
(priority = 100): MethodDecorator =>
(priority = DEFAULT_PRIORITY): MethodDecorator =>
(prototype, propertyKey, descriptor) => {
const serviceClass = prototype.constructor as ServiceClass;
const methodName = String(propertyKey);