Skip to content

Commit d0be9ac

Browse files
author
Derek Bredensteiner
committed
Make response for "connected" return null when activeMasterClient is still null. (As in on startup, if a client instantly checks connected, the activeMasterClient will still be null and not set yet from the sentinel query).
1 parent 2efa882 commit d0be9ac

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/sentinel.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,11 @@ RedisSentinelClient.prototype.getMaster = function getMaster() {
312312
'stream' /* ?? */
313313
].forEach(function(staticProp){
314314
RedisSentinelClient.prototype.__defineGetter__(staticProp, function(){
315-
return this.activeMasterClient[staticProp];
315+
if (this.activeMasterClient !== null) {
316+
return this.activeMasterClient[staticProp];
317+
} else {
318+
return null;
319+
}
316320
});
317321

318322
// might as well have a setter too...?

0 commit comments

Comments
 (0)