From bf2b1c957a8ca2f8191ce6ba24b67e63158c361e Mon Sep 17 00:00:00 2001 From: John Crepezzi Date: Wed, 19 Sep 2018 10:37:34 -0400 Subject: [PATCH] Handle redis error and re-establish connection --- lib/document_stores/redis.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/document_stores/redis.js b/lib/document_stores/redis.js index 7edbaf0..eed07e7 100644 --- a/lib/document_stores/redis.js +++ b/lib/document_stores/redis.js @@ -29,6 +29,11 @@ RedisDocumentStore.connect = function(options) { if (options.password) { RedisDocumentStore.client.auth(options.password); } + + RedisDocumentStore.client.on('error', function(err) { + winston.error('redis disconnected', err); + }); + RedisDocumentStore.client.select(index, function(err) { if (err) { winston.error(