Skip to content

Commit

Permalink
able to pass redis client to resque connection directly
Browse files Browse the repository at this point in the history
  • Loading branch information
flyerhzm committed Mar 18, 2014
1 parent b04a964 commit bf3a2ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -51,4 +51,4 @@ connection.prototype.key = function(){
return args.join(":");
}

exports.connection = connection;
exports.connection = connection;

0 comments on commit bf3a2ff

Please sign in to comment.