From a79b999e7a01b320b6d30389a8f131ab0d219448 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Mon, 11 Feb 2013 15:05:23 +0100 Subject: [PATCH] Do not try to send commands to an unoconnected redis client This changes "Cannot read property 'HGET' of null" messages into "Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED". --- lib/cartodb/carto_data.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/cartodb/carto_data.js b/lib/cartodb/carto_data.js index dc2c71ea..e43b7233 100644 --- a/lib/cartodb/carto_data.js +++ b/lib/cartodb/carto_data.js @@ -223,6 +223,7 @@ module.exports = function() { redis_pool.acquire(db, this); }, function executeQuery(err, data) { + if ( err ) throw err; redisClient = data; redisArgs.push(this); redisClient[redisFunc.toUpperCase()].apply(redisClient, redisArgs);