|
|
@ -3,7 +3,18 @@ |
|
|
|
const redis = require("ioredis") |
|
|
|
|
|
|
|
module.exports = async function factory (app, opts) { |
|
|
|
let client = new redis(opts.redis.port, opts.redis.host, { |
|
|
|
let client = opts.redis.pwd ? |
|
|
|
new redis.Cluster([ |
|
|
|
{ |
|
|
|
host: opts.redis.host, |
|
|
|
port: opts.redis.port |
|
|
|
} |
|
|
|
], { |
|
|
|
redisOptions: { |
|
|
|
password: opts.redis.pwd, |
|
|
|
}, |
|
|
|
}) |
|
|
|
: new redis(opts.redis.port, opts.redis.host, { |
|
|
|
password: opts.redis.pwd, |
|
|
|
}); |
|
|
|
|
|
|
|