From 656706a2630670060033c5fd43ae0a7dbd988a49 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 14 Sep 2015 15:45:28 +0200 Subject: [PATCH] Reduce the reauthenticate timeout to 333ms It should not take all that long to load everything into redis --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index f724d56060..3dd3b2e29f 100644 --- a/index.js +++ b/index.js @@ -193,7 +193,7 @@ RedisClient.prototype.on_error = function (msg) { this.ready = false; this.emit("error", new Error(message)); - // "error" events get turned into exceptions if they aren't listened for. If the user handled this error + // "error" events get turned into exceptions if they aren't listened for. If the user handled this error // then we should try to reconnect. this.connection_gone("error"); }; @@ -211,11 +211,11 @@ RedisClient.prototype.do_auth = function () { if (err) { /* istanbul ignore if: this is almost impossible to test */ 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"); setTimeout(function () { self.do_auth(); - }, 2000); // TODO - magic number alert + }, 333); return; } else if (noPasswordIsSet.test(err.message)) { debug("Warning: Redis server does not require a password, but a password was supplied."); @@ -238,7 +238,7 @@ RedisClient.prototype.do_auth = function () { self.auth_callback = null; } - // now we are really connected + // Now we are really connected self.emit("connect"); self.initialize_retry_vars();