@@ -43,9 +43,6 @@ function RedisMetaClient(masterName, startingSentinels) {
43
43
}
44
44
}
45
45
self . messagesReceived = newLastMessages ;
46
-
47
-
48
- console . log ( self . masterClients . length ) ;
49
46
} , 2000 ) ;
50
47
51
48
this . getSentinels ( startingSentinels , function ( error , sentinelsConfig ) {
@@ -68,7 +65,6 @@ function RedisMetaClient(masterName, startingSentinels) {
68
65
this . on ( 'sentinelsConfigured' , function ( ) {
69
66
self . sentinelsConfigured ( ) ;
70
67
} ) ;
71
-
72
68
}
73
69
74
70
util . inherits ( RedisMetaClient , events . EventEmitter ) ;
@@ -455,6 +451,7 @@ RedisMetaClient.prototype.masterAvailable = function(availableMaster) {
455
451
this . masterClients . forEach ( function ( masterClient ) {
456
452
masterClient . client . host = availableMaster . host ;
457
453
masterClient . client . port = availableMaster . port ;
454
+ masterClient . client . forceReconnectionAttempt ( ) ;
458
455
} ) ;
459
456
460
457
this . emit ( 'healthyChange' , true ) ;
@@ -477,42 +474,4 @@ RedisMetaClient.prototype.createMasterClient = function(options) {
477
474
return client ;
478
475
} ;
479
476
480
- // RedisMetaClient.prototype.getMasterClient = function(options, cb) {
481
-
482
- // if(this.healthy){
483
- // return RedisSingleClient.createClient(this.master.port, this.master.host, options);
484
- // }
485
- // else {
486
- // var client = {};
487
- // for (var i in RedisSingleClient.RedisClient.prototype) {
488
- // console.log(i);
489
-
490
- // }
491
- // }
492
- // // for (var i in RedisSingleClient.RedisClient.prototype) {
493
- // // console.log(i);
494
- // // if(healthy){
495
-
496
- // // }
497
- // // else {
498
-
499
- // // }
500
- // // }
501
- // // if(this.healthy && this.masterClient) {
502
- // // return cb(null, this.masterClient);
503
- // // } else {
504
- // // if(this.healthy && !this.masterClient){
505
- // // console.log("this.masterClient not available");
506
- // // }
507
- // // return cb("Unhealthy");
508
- // // }
509
- // // console.log(this.healthy);
510
- // // console.log(this.master.port);
511
- // // if(this.masterClient) {
512
- // // return this.masterClient;
513
- // // } else {
514
- // // return false;
515
- // // }
516
- // };
517
-
518
477
exports . RedisMetaClient = RedisMetaClient ;
0 commit comments