mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
fix(core): Disconnect Redis after pausing queue during worker shutdown (#9928)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -4,7 +4,7 @@ import { Logger } from '@/Logger';
|
||||
import ioRedis from 'ioredis';
|
||||
import type { Cluster, RedisOptions } from 'ioredis';
|
||||
import type { RedisClientType } from './RedisServiceBaseClasses';
|
||||
import { OnShutdown } from '@/decorators/OnShutdown';
|
||||
import { LOWEST_PRIORITY, OnShutdown } from '@/decorators/OnShutdown';
|
||||
|
||||
@Service()
|
||||
export class RedisClientService {
|
||||
@@ -23,7 +23,7 @@ export class RedisClientService {
|
||||
return client;
|
||||
}
|
||||
|
||||
@OnShutdown()
|
||||
@OnShutdown(LOWEST_PRIORITY)
|
||||
disconnectClients() {
|
||||
for (const client of this.clients) {
|
||||
client.disconnect();
|
||||
@@ -144,6 +144,8 @@ export class RedisClientService {
|
||||
}
|
||||
}
|
||||
|
||||
this.logger.warn('Redis unavailable - trying to reconnect...');
|
||||
|
||||
return RETRY_INTERVAL;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user