Skip to content

Commit

Permalink
revert(core): Stop explicit redis client disconnect on shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Aug 26, 2024
1 parent 352aa2a commit b2831ba
Showing 1 changed file with 2 additions and 11 deletions.
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

0 comments on commit b2831ba

Please sign in to comment.