nodejs terminates on redis failure nodejs terminates on redis failure express express

nodejs terminates on redis failure


It seems like you don't have an error handler for your redis client instance. Can you provide some excerpt from your code? Probably we can help you better that way. Just an error message is a bit less.

If I had to guess then I'd say you have no error handler...

See here: https://github.com/mranney/node_redis#usage

Do you have a on error callback?

Example:

var redis = require("redis"),client = redis.createClient();// This is required so your error doesn't bubble// upwards and kills your instanceclient.on("error", function (err) {    console.log("Error " + err);});

The node_redis client automatically reconnects so you don't need to handle that although you can configure a max_attempts and other options. See here: https://github.com/mranney/node_redis#rediscreateclientport-host-options

I hope I could provide some useful information


if you are using socket.io redisAdapter, then do this after creating your socket.io server :

io.of('/').adapter.on('error', (err)=>{console.log('adapter error',err)});