Do not leak redis client connections on redis command error

This commit is contained in:
Sandro Santilli 2013-01-28 17:13:49 +01:00
parent b130b67f24
commit ac49abe750

View File

@ -232,8 +232,7 @@ module.exports = function() {
redisClient[redisFunc.toUpperCase()].apply(redisClient, redisArgs);
},
function releaseRedisClient(err, data) {
if (err) throw err;
redis_pool.release(db, redisClient);
if ( ! _.isUndefined(redisClient) ) redis_pool.release(db, redisClient);
callback(err, data);
}
);