Skip to content
This repository was archived by the owner on Sep 25, 2023. It is now read-only.

Commit 1b60e66

Browse files
author
xuyang
committed
fix bug in redis client disconnect
1 parent 1eb91c8 commit 1b60e66

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

lib/monitors/redismonitor.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Monitor.prototype.start = function(cb) {
7676
Monitor.prototype.stop = function() {
7777
this.client.disconnect();
7878
if (!!this.pingRedis) {
79-
this.pingRedis.disconnect();
79+
this.pingRedis.end();
8080
}
8181
clearInterval(this.timer);
8282
};
@@ -183,14 +183,14 @@ var getMaster = function(self, redisNodes) {
183183
ping(self, client, redis);
184184
}, constants.TIME.DEFAULT_REDIS_PING);
185185
} else {
186-
client.disconnect();
186+
client.end();
187187
client = null;
188188
}
189189
});
190190
});
191191
client.on('error', function() {
192192
logger.error('[redisMonitor] monitor redis connect error');
193-
client.disconnect();
193+
client.end();
194194
client = null;
195195
});
196196
})(i);
@@ -203,7 +203,7 @@ var ping = function(self, client, rds) {
203203
clearInterval(self.pingtimer);
204204
if(self.pingtimer) {
205205
logger.info('[redisMonitor] clear pingtimer timeout');
206-
client.disconnect();
206+
client.end();
207207
client = null;
208208
self.pingtimer = null;
209209
rds.disconnect();
@@ -225,7 +225,7 @@ var clearPingTimer = function(self, cb) {
225225
clearInterval(self.pingtimer);
226226
var client = self.pingRedis;
227227
if(!!client) {
228-
client.disconnect();
228+
client.end();
229229
client = null;
230230
self.pingtimer = null;
231231
}

0 commit comments

Comments
 (0)