Skip to content

Commit

Permalink
Merge remote branch 'Tim_Smart/retry-loop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mranney committed Sep 18, 2010
2 parents 715b097 + b55d7c6 commit 243f638
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,9 @@ function RedisClient(stream) {
var self = this;

this.stream.on("connect", function () {
if (exports.debug_mode) {
console.log("Stream connected");
}
self.connected = true;
self.connections += 1;
self.command_queue = new Queue();
Expand All @@ -319,6 +322,7 @@ function RedisClient(stream) {
console.log("Redis reply parser error: " + err.stack);
});

self.retry_timer = null;
self.retry_delay = 250;
self.stream.setNoDelay();
self.stream.setTimeout(0);
Expand Down Expand Up @@ -391,7 +395,6 @@ RedisClient.prototype.connection_gone = function () {
if (exports.debug_mode) {
console.log("Retrying conneciton...");
}
self.retry_timer = null;
self.retry_delay = self.retry_delay * self.retry_backoff;
self.stream.destroy();
self.stream.connect(self.port, self.host);
Expand Down

0 comments on commit 243f638

Please sign in to comment.