Skip to content

Commit 7560550

Browse files
Use existing connection_id
1 parent f34fde2 commit 7560550

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sentinel.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,18 +464,18 @@ RedisMetaClient.prototype.createMasterClient = function(options) {
464464
options = options || {};
465465
options.allowNoSocket = true;
466466
var client = RedisSingleClient.createClient(this.master.port, this.master.host, options);
467-
var id = ++this.masterClientId;
468467
var self = this;
468+
var connection_id = client.connection_id;
469469
client.on('error', function(){});
470470
client.on('end', function(){
471471
for (var i = 0, len = self.masterClients.length; i < len; i++) {
472472
var cl = self.masterClients[i];
473-
if(cl.client.closing === true && id === cl.id){
473+
if(cl.client.closing === true && connection_id === cl.client.connection_id){
474474
self.masterClients = self.masterClients.slice(i, 1);
475475
}
476476
}
477477
});
478-
this.masterClients.push({config: this.master, client: client, id: id});
478+
this.masterClients.push({config: this.master, client: client});
479479
return client;
480480
};
481481

0 commit comments

Comments
 (0)