From 45a990b2f8bc4cdc527e490c5825dafe422dc3ca Mon Sep 17 00:00:00 2001 From: Cory Imdieke <cory.imdieke@gmail.com> Date: Tue, 1 Aug 2023 11:43:05 -0500 Subject: [PATCH 1/4] Fixed Redis 4 Reconnect Issue Signed-off-by: Cory Imdieke <cory.imdieke@gmail.com> --- 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..9d6b71c936 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 Redis Client error', { error: err })); + this.client.on('connect', () => {}); + this.client.on('reconnecting', () => {}); + this.client.on('ready', () => {}); } async connect() { From bf3fd63754cb163d648238214f8cad203a93c34d Mon Sep 17 00:00:00 2001 From: Cory Imdieke <cory.imdieke@gmail.com> Date: Tue, 1 Aug 2023 11:50:33 -0500 Subject: [PATCH 2/4] Cleaned up spacing Signed-off-by: Cory Imdieke <cory.imdieke@gmail.com> --- src/Adapters/Cache/RedisCacheAdapter.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Adapters/Cache/RedisCacheAdapter.js b/src/Adapters/Cache/RedisCacheAdapter.js index 9d6b71c936..9476ed7169 100644 --- a/src/Adapters/Cache/RedisCacheAdapter.js +++ b/src/Adapters/Cache/RedisCacheAdapter.js @@ -17,10 +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 Redis Client error', { error: err })); - this.client.on('connect', () => {}); - this.client.on('reconnecting', () => {}); - this.client.on('ready', () => {}); + this.client.on('error', err => _logger.error('RedisCacheAdapter Redis Client error', { error: err })); + this.client.on('connect', () => {}); + this.client.on('reconnecting', () => {}); + this.client.on('ready', () => {}); } async connect() { From 877e77e9f82cacf17e7b1c47292f5b9668abed04 Mon Sep 17 00:00:00 2001 From: Cory Imdieke <cory.imdieke@gmail.com> Date: Tue, 1 Aug 2023 11:54:58 -0500 Subject: [PATCH 3/4] Removed logging in favor of auto reconnect to match old behavior Signed-off-by: Cory Imdieke <cory.imdieke@gmail.com> --- src/Adapters/Cache/RedisCacheAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Adapters/Cache/RedisCacheAdapter.js b/src/Adapters/Cache/RedisCacheAdapter.js index 9476ed7169..d8de9ecbdc 100644 --- a/src/Adapters/Cache/RedisCacheAdapter.js +++ b/src/Adapters/Cache/RedisCacheAdapter.js @@ -17,7 +17,7 @@ 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 Redis Client error', { error: err })); + this.client.on('error', err => {}); this.client.on('connect', () => {}); this.client.on('reconnecting', () => {}); this.client.on('ready', () => {}); From 83aba07fed8cc73d3254ddba1325f206c5467b3e Mon Sep 17 00:00:00 2001 From: Cory Imdieke <cory.imdieke@gmail.com> Date: Sun, 20 Aug 2023 12:25:06 -0500 Subject: [PATCH 4/4] Update to fix lint error Signed-off-by: Cory Imdieke <cory.imdieke@gmail.com> --- src/Adapters/Cache/RedisCacheAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Adapters/Cache/RedisCacheAdapter.js b/src/Adapters/Cache/RedisCacheAdapter.js index d8de9ecbdc..a0345a1101 100644 --- a/src/Adapters/Cache/RedisCacheAdapter.js +++ b/src/Adapters/Cache/RedisCacheAdapter.js @@ -17,7 +17,7 @@ export class RedisCacheAdapter { this.ttl = isValidTTL(ttl) ? ttl : DEFAULT_REDIS_TTL; this.client = createClient(redisCtx); this.queue = new KeyPromiseQueue(); - this.client.on('error', err => {}); + this.client.on('error', err => { logger.error('RedisCacheAdapter client error', { error: err }) }); this.client.on('connect', () => {}); this.client.on('reconnecting', () => {}); this.client.on('ready', () => {});