|
|
@@ -15,18 +15,18 @@ module.exports = function(conf)
|
|
|
*/
|
|
|
var init = () => {
|
|
|
this.conf = conf;
|
|
|
- var socket = { host: conf.redis_host, port: conf.redis_port };
|
|
|
+ var socket = { host: conf.redis_host, port: conf.redis_port };
|
|
|
// noderedis密码等选项
|
|
|
var options = { legacyMode: true, password: conf.redis_pwd, socket: socket };
|
|
|
- if (!options.password) delete options.password;
|
|
|
+ if (!options.password) delete options.password;
|
|
|
// redis client instance
|
|
|
this.client = redis.createClient(options);
|
|
|
|
|
|
this.client.on("error", (err) => {
|
|
|
- console.log("redis Error " + err);
|
|
|
+ console.log("redis Error " + err);
|
|
|
});
|
|
|
|
|
|
- return this.client.connect();
|
|
|
+ return this.client.connect();
|
|
|
}
|
|
|
|
|
|
/**
|