1
0
Fork 0
mirror of https://github.com/SunRed/haste-server.git synced 2024-11-23 17:50:19 +01:00

Merge pull request #251 from seejohnrun/handle-redis-disconnect

Handle redis error and re-establish connection
This commit is contained in:
John Crepezzi 2018-09-19 10:38:34 -04:00 committed by GitHub
commit f3838ab4a8
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,6 +29,11 @@ RedisDocumentStore.connect = function(options) {
if (options.password) { if (options.password) {
RedisDocumentStore.client.auth(options.password); RedisDocumentStore.client.auth(options.password);
} }
RedisDocumentStore.client.on('error', function(err) {
winston.error('redis disconnected', err);
});
RedisDocumentStore.client.select(index, function(err) { RedisDocumentStore.client.select(index, function(err) {
if (err) { if (err) {
winston.error( winston.error(