From 2b3d4e5d3c85cd142f85af68dec51a8523548d49 Mon Sep 17 00:00:00 2001 From: Cory Imdieke Date: Tue, 29 Aug 2023 19:52:13 -0500 Subject: [PATCH] fix: Redis 4 does not reconnect after unhandled error (#8706) --- src/Adapters/Cache/RedisCacheAdapter.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Adapters/Cache/RedisCacheAdapter.js b/src/Adapters/Cache/RedisCacheAdapter.js index eba16694e3..a0345a1101 100644 --- a/src/Adapters/Cache/RedisCacheAdapter.js +++ b/src/Adapters/Cache/RedisCacheAdapter.js @@ -17,6 +17,10 @@ export class RedisCacheAdapter { this.ttl = isValidTTL(ttl) ? ttl : DEFAULT_REDIS_TTL; this.client = createClient(redisCtx); this.queue = new KeyPromiseQueue(); + this.client.on('error', err => { logger.error('RedisCacheAdapter client error', { error: err }) }); + this.client.on('connect', () => {}); + this.client.on('reconnecting', () => {}); + this.client.on('ready', () => {}); } async connect() {