diff --git a/lib/server.js b/lib/server.js index 1f920a9..8f28dc2 100644 --- a/lib/server.js +++ b/lib/server.js @@ -59,7 +59,21 @@ Server.prototype.sendCommand = function(command, id, cb){ return cb(err); } logger.debug('sending command to redis '+ command); - conn.write(command); + + try { + conn.write(command, function (err) { + if (err) { + logger.error(err); + } + }); + } + catch (e) { + logger.error(e); + //TODO: in this case we should either return that the command send failed + //or queue it until another redis server is available. + + } + return cb(null, conn); }); };