diff --git a/src/Adapters/PubSub/RedisPubSub.js b/src/Adapters/PubSub/RedisPubSub.js index cc2b3a9792..5fd65182df 100644 --- a/src/Adapters/PubSub/RedisPubSub.js +++ b/src/Adapters/PubSub/RedisPubSub.js @@ -1,13 +1,34 @@ import { createClient } from 'redis'; +import logger from '../../logger'; function createPublisher({ redisURL, redisOptions = {} }): any { redisOptions.no_ready_check = true; - return createClient({ url: redisURL, ...redisOptions }); + const client = createClient({ url: redisURL, ...redisOptions }); + client.on('error', err => { + logger.error('RedisCacheAdapter Publisher client error', { + error: err + }); + }); + client.on('connect', () => {}); + client.on('reconnecting', () => {}); + client.on('ready', () => {}); + client.on('end', () => {}); + return client; } function createSubscriber({ redisURL, redisOptions = {} }): any { redisOptions.no_ready_check = true; - return createClient({ url: redisURL, ...redisOptions }); + const client = createClient({ url: redisURL, ...redisOptions }); + client.on('error', err => { + logger.error('RedisCacheAdapter Subscriber client error', { + error: err + }); + }); + client.on('connect', () => {}); + client.on('reconnecting', () => {}); + client.on('ready', () => {}); + client.on('end', () => {}); + return client; } const RedisPubSub = {