You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
Merge pull request #843 from fintura/reduce-timeout
Reduce the reauthenticate timeout to 333ms
This commit is contained in:
6
index.js
6
index.js
@@ -186,11 +186,11 @@ RedisClient.prototype.do_auth = function () {
|
|||||||
if (err) {
|
if (err) {
|
||||||
/* istanbul ignore if: this is almost impossible to test */
|
/* istanbul ignore if: this is almost impossible to test */
|
||||||
if (loading.test(err.message)) {
|
if (loading.test(err.message)) {
|
||||||
// if redis is still loading the db, it will not authenticate and everything else will fail
|
// If redis is still loading the db, it will not authenticate and everything else will fail
|
||||||
debug("Redis still loading, trying to authenticate later");
|
debug("Redis still loading, trying to authenticate later");
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
self.do_auth();
|
self.do_auth();
|
||||||
}, 2000); // TODO - magic number alert
|
}, 333);
|
||||||
return;
|
return;
|
||||||
} else if (noPasswordIsSet.test(err.message)) {
|
} else if (noPasswordIsSet.test(err.message)) {
|
||||||
debug("Warning: Redis server does not require a password, but a password was supplied.");
|
debug("Warning: Redis server does not require a password, but a password was supplied.");
|
||||||
@@ -213,7 +213,7 @@ RedisClient.prototype.do_auth = function () {
|
|||||||
self.auth_callback = null;
|
self.auth_callback = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// now we are really connected
|
// Now we are really connected
|
||||||
self.emit("connect");
|
self.emit("connect");
|
||||||
self.initialize_retry_vars();
|
self.initialize_retry_vars();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user