diff --git a/redis.js b/redis.js index 0f2f211f9..c37fcc64e 100644 --- a/redis.js +++ b/redis.js @@ -4,7 +4,7 @@ const url = process.env.TALK_REDIS_URL || 'redis://localhost'; const client = redis.createClient(url, { retry_strategy: function(options) { - if (options.error.code === 'ECONNREFUSED') { + if (options.error && options.error.code === 'ECONNREFUSED') { // End reconnecting on a specific error and flush all commands with a individual error return new Error('The server refused the connection'); @@ -26,10 +26,6 @@ const client = redis.createClient(url, { } }); -// client.on('error', (err) => { -// throw err; -// }); - client.ping((err) => { if (err) { console.error('Can\'t ping the redis server!');