|
@ -3,10 +3,12 @@ |
|
|
const redis = require("ioredis") |
|
|
const redis = require("ioredis") |
|
|
|
|
|
|
|
|
module.exports = async function factory (app, opts) { |
|
|
module.exports = async function factory (app, opts) { |
|
|
let client = new redis(opts.redis.port, opts.redis.host); |
|
|
let client = new redis(opts.redis.port, opts.redis.host, { |
|
|
|
|
|
password: opts.redis.pwd, |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
client.on("error", function (err) { |
|
|
client.on("error", function (err) { |
|
|
app.fs.logger.error('info', '[FS-AUTH-REDIS]', `redis connect error. ${opts.redis.host + ':' + opts.redis.port}` ); |
|
|
app.fs.logger.error('info', '[FS-AUTH-REDIS]', `redis connect error. ${opts.redis.host + ':' + opts.redis.port}`); |
|
|
// console.error("Error :", err);
|
|
|
// console.error("Error :", err);
|
|
|
// process.exit(-1);
|
|
|
// process.exit(-1);
|
|
|
}); |
|
|
}); |
|
|