From bf3a2ffa2ed70d5cd18259deffdf4d699901fe7e Mon Sep 17 00:00:00 2001 From: Richard Huang Date: Tue, 18 Mar 2014 20:15:49 +0800 Subject: [PATCH] able to pass redis client to resque connection directly --- lib/connection.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/connection.js b/lib/connection.js index e33d99e8..af085832 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -23,13 +23,13 @@ connection.prototype.defaults = function(){ connection.prototype.connect = function(callback){ var self = this; var options = self.options; - self.redis = options.package.createClient(options.port, options.host, options.options); + self.redis = options.redis || options.package.createClient(options.port, options.host, options.options); if(options.password != null && options.password != "" && self.options.fake != true){ self.redis.auth(options.password, function(err){ self.redis.select(options.database, function(err){ callback(err); }); - }); + }); }else if(self.options.fake != true){ self.redis.select(options.database, function(err){ callback(err); @@ -51,4 +51,4 @@ connection.prototype.key = function(){ return args.join(":"); } -exports.connection = connection; \ No newline at end of file +exports.connection = connection;