Skip to content

Commit 656706a

Browse files
author
Ruben Bridgewater
committed
Reduce the reauthenticate timeout to 333ms
It should not take all that long to load everything into redis
1 parent 06121a6 commit 656706a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ RedisClient.prototype.on_error = function (msg) {
193193
this.ready = false;
194194

195195
this.emit("error", new Error(message));
196-
// "error" events get turned into exceptions if they aren't listened for. If the user handled this error
196+
// "error" events get turned into exceptions if they aren't listened for. If the user handled this error
197197
// then we should try to reconnect.
198198
this.connection_gone("error");
199199
};
@@ -211,11 +211,11 @@ RedisClient.prototype.do_auth = function () {
211211
if (err) {
212212
/* istanbul ignore if: this is almost impossible to test */
213213
if (loading.test(err.message)) {
214-
// if redis is still loading the db, it will not authenticate and everything else will fail
214+
// If redis is still loading the db, it will not authenticate and everything else will fail
215215
debug("Redis still loading, trying to authenticate later");
216216
setTimeout(function () {
217217
self.do_auth();
218-
}, 2000); // TODO - magic number alert
218+
}, 333);
219219
return;
220220
} else if (noPasswordIsSet.test(err.message)) {
221221
debug("Warning: Redis server does not require a password, but a password was supplied.");
@@ -238,7 +238,7 @@ RedisClient.prototype.do_auth = function () {
238238
self.auth_callback = null;
239239
}
240240

241-
// now we are really connected
241+
// Now we are really connected
242242
self.emit("connect");
243243
self.initialize_retry_vars();
244244

0 commit comments

Comments
 (0)