Skip to content

Commit

Permalink
feat(cluster): add option to control timeout on cluster slots refresh (
Browse files Browse the repository at this point in the history
…#475)

* add option to control refresh slots timeout

* rename as per issue

* missed one
  • Loading branch information
damianhodgkiss authored and luin committed May 30, 2017
1 parent e7b6352 commit 493d095
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/cluster/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ var DelayQueue = require('./delay_queue');
* if `retryDelayOnClusterDown` is valid delay time.
* @param {number} [options.retryDelayOnTryAgain=100] - When a TRYAGAIN error is received, client will retry
* if `retryDelayOnTryAgain` is valid delay time.
* @param {number} [options.slotsRefreshTimeout=1000] - The milliseconds before a timeout occurs while refreshing
* slots from the cluster.
* @param {Object} [options.redisOptions] - Passed to the constructor of `Redis`.
* @extends [EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter)
* @extends Commander
Expand Down Expand Up @@ -103,7 +105,8 @@ Cluster.defaultOptions = {
maxRedirections: 16,
retryDelayOnFailover: 100,
retryDelayOnClusterDown: 100,
retryDelayOnTryAgain: 100
retryDelayOnTryAgain: 100,
slotsRefreshTimeout: 1000
};

util.inherits(Cluster, EventEmitter);
Expand Down Expand Up @@ -609,7 +612,7 @@ Cluster.prototype.getInfoFromNode = function (redis, callback) {

_this.connectionPool.reset(nodes);
callback();
}, 1000));
}, this.options.slotsRefreshTimeout));
};

/**
Expand Down

0 comments on commit 493d095

Please sign in to comment.