You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't find a way to close the connection using @tirke/node-cache-manager-ioredis, either in the cache manager or the store implementation. Does anyone have insights on how to call redis.disconnect() or redis.quit()?
Jest has detected the following 1 open handle potentially keeping Jest from exiting:
● TCPWRAP
33 | public static async getInstance(): Promise<ICacheService> {
34 |if (!RedisStoreProvider.instance) {
> 35 | const cache: Cache = await caching(ioRedisStore, redisConfig);| ^
36 | cache.on('error', (error: unknown) => {
37 | logError('Redis store error', error);
38 | });
at node_modules/ioredis/built/connectors/StandaloneConnector.js:44:21
at StandaloneConnector.connect (node_modules/ioredis/built/connectors/StandaloneConnector.js:43:16)
at node_modules/ioredis/built/Redis.js:121:64
at EventEmitter.connect (node_modules/ioredis/built/Redis.js:103:25)
at new Redis (node_modules/ioredis/built/Redis.js:77:18)
at new RedisStore (node_modules/@tirke/node-cache-manager-ioredis/index.js:57:21)
at ioRedisStore (node_modules/@tirke/node-cache-manager-ioredis/index.js:124:10)
at caching (node_modules/cache-manager/dist/caching.js:19:29)
The text was updated successfully, but these errors were encountered:
Makhlab
changed the title
How to close Redis connection gracefully?
Gracefully Closing a Redis Connection: Best Practices?
Jun 1, 2024
Hello @Makhlab in your example you can access the underlying redis client at cache.store.client.
Disconnecting manually is accessible through cache.store.client.disconnect()
I can't find a way to close the connection using @tirke/node-cache-manager-ioredis, either in the cache manager or the store implementation. Does anyone have insights on how to call redis.disconnect() or redis.quit()?
Jest has detected the following 1 open handle potentially keeping Jest from exiting:
The text was updated successfully, but these errors were encountered: