Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): Stop explicit redis client disconnect on shutdown #10551

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions packages/cli/src/services/redis/redis-client.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ import { Service } from 'typedi';
import { Logger } from '@/logger';
import ioRedis from 'ioredis';
import type { Cluster, RedisOptions } from 'ioredis';
import type { RedisClientType } from './redis.types';

import { OnShutdown } from '@/decorators/on-shutdown';
import { LOWEST_SHUTDOWN_PRIORITY } from '@/constants';
import { GlobalConfig } from '@n8n/config';

import type { RedisClientType } from './redis.types';

@Service()
export class RedisClientService {
private readonly clients = new Set<ioRedis | Cluster>();
Expand All @@ -28,13 +26,6 @@ export class RedisClientService {
return client;
}

@OnShutdown(LOWEST_SHUTDOWN_PRIORITY)
disconnectClients() {
for (const client of this.clients) {
client.disconnect();
}
}

/**
* Ensure prefix is wrapped in curly braces for Redis cluster.
* See: https://github.com/OptimalBits/bull/blob/develop/PATTERNS.md
Expand Down
Loading