From 1c983a11717625471d3671677a639c10b353732c Mon Sep 17 00:00:00 2001 From: linkangzhen Date: Tue, 27 May 2014 09:01:28 +0800 Subject: [PATCH 1/2] fixed redis quit,we call client.end(),remove "error" event listener,the retry_timer try to connect;when there is a "error" exception,the process will exit --- index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.js b/index.js index 13964983e0..12e9c7aa2e 100644 --- a/index.js +++ b/index.js @@ -908,6 +908,14 @@ RedisClient.prototype.pub_sub_command = function (command_obj) { RedisClient.prototype.end = function () { this.stream._events = {}; + + if(this.retry_timer){ + clearTimeout(this.retry_timer); + this.retry_timer=null; + this.stream.on("error", function(){ + }); + } + this.connected = false; this.ready = false; this.closing = true; From c7dbfec85ccb011353e7320109203bb936386ba9 Mon Sep 17 00:00:00 2001 From: linkangzhen Date: Tue, 27 May 2014 09:14:01 +0800 Subject: [PATCH 2/2] prototype.end move on("error", to outsite --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 12e9c7aa2e..8c4d51d59b 100644 --- a/index.js +++ b/index.js @@ -909,12 +909,12 @@ RedisClient.prototype.pub_sub_command = function (command_obj) { RedisClient.prototype.end = function () { this.stream._events = {}; + //clear retry_timer if(this.retry_timer){ clearTimeout(this.retry_timer); this.retry_timer=null; - this.stream.on("error", function(){ - }); } + this.stream.on("error", function(){}); this.connected = false; this.ready = false;