From 3e515fcf9781aac92d4a5eda66871a2f13568167 Mon Sep 17 00:00:00 2001 From: Arthur Schreiber Date: Thu, 28 May 2015 16:59:58 +0200 Subject: [PATCH] Only disconnect connections that were established by node-resque. --- lib/connection.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/connection.js b/lib/connection.js index e53c8812..003a2df0 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -98,7 +98,10 @@ connection.prototype.connect = function(callback){ connection.prototype.disconnect = function(){ var self = this; - return self.redis.quit(); + // Only disconnect if we established the redis connection on our own. + if (!self.options.redis) { + return self.redis.quit(); + } } connection.prototype.key = function(){