From 29c408cbf126dcb03cfa6f24a459b6f6e091015a Mon Sep 17 00:00:00 2001 From: Matt Ranney Date: Mon, 14 Nov 2011 20:23:11 -1000 Subject: [PATCH] Update TODO comment for retry thresholds. --- index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 3892baa453..fcee3308f2 100644 --- a/index.js +++ b/index.js @@ -381,11 +381,12 @@ RedisClient.prototype.connection_gone = function (why) { if (this.max_attempts && this.attempts >= this.max_attempts) { this.retry_timer = null; - // TODO - engage Redis is Broken mode for future commands - this.emit("not_reconnecting", "Aborting connection attempt: Max attempts " + this.max_attempts + " failed."); + // TODO - some people need a "Redis is Broken mode" for future commands that errors immediately, and others + // want the program to exit. Right now, we just log, which doesn't really help in either case. + console.error("node_redis: Couldn't get Redis connection after " + this.max_attempts + " attempts."); return; } - + self.attempts += 1; self.emit("reconnecting", { delay: self.retry_delay, @@ -400,11 +401,11 @@ RedisClient.prototype.connection_gone = function (why) { if (self.connect_timeout && self.retry_totaltime >= self.connect_timeout) { self.retry_timer = null; - // TODO - engage Redis is Broken mode for future commands - self.emit("not_reconnecting", "Aborting connection attempt: Total timeout of " + self.connect_timeout + "ms exceeded."); + // TODO - engage Redis is Broken mode for future commands, or whatever + console.error("node_redis: Couldn't get Redis connection after " + self.retry_totaltime + "ms."); return; } - + self.stream.connect(self.port, self.host); self.retry_timer = null; }, this.current_retry_delay);