From b130b67f248224c42800dc1289153a4ccd2985d9 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Mon, 28 Jan 2013 17:12:21 +0100 Subject: [PATCH] Check redis connection at pool creation time --- lib/cartodb/redis_pool.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/cartodb/redis_pool.js b/lib/cartodb/redis_pool.js index ea5c1bd5..d2c40cc2 100644 --- a/lib/cartodb/redis_pool.js +++ b/lib/cartodb/redis_pool.js @@ -58,8 +58,11 @@ var RedisPool = function(opts){ client.send_anyway = true; client.select(database); client.send_anyway = false; + callback(null, client); }); - return callback(null, client); + client.on('error', function (err) { + callback(err, null); + }); }, destroy: function(client) { return client.quit();