Skip to content

Commit

Permalink
fixed missed options.isRedisCluster too
Browse files Browse the repository at this point in the history
  • Loading branch information
yinhewang authored and yinhewang committed Aug 6, 2018
1 parent 4f414dd commit 1e98f58
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions index.js
Expand Up @@ -25,6 +25,7 @@ var wrap = require('co-wrap-all');
* Initialize redis session middleware with `opts` (see the README for more info):
*
* @param {Object} options
* - {Boolean} isRedisCluster redis is cluster
* - {Object} client redis client (overides all other options except db and duplicate)
* - {String} socket redis connect socket (DEPRECATED: use 'path' instead)
* - {String} db redis db
Expand All @@ -47,10 +48,10 @@ var RedisStore = module.exports = function (options) {
// client = redis.createClient(options);
//
// Apply ioredis, Add has redis cluster condition:
if (options.isRedisCluster) {
client = new ioredis.Cluster(options.nodes, {redisOptions: options.redisOptions});
} else {
if (!options.isRedisCluster) {
client = redis.createClient(options);
} else {
client = new ioredis.Cluster(options.nodes, {redisOptions: options.redisOptions});
}
} else {
if (options.duplicate) { // Duplicate client and update with options provided
Expand Down

0 comments on commit 1e98f58

Please sign in to comment.