1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Do not emit ready if the slave is still syncing with master / master being down

This commit is contained in:
Ruben Bridgewater
2016-03-01 16:58:42 +01:00
parent 89209b8adc
commit 19ea518b36

View File

@@ -389,9 +389,15 @@ RedisClient.prototype.on_info_cmd = function (err, res) {
}
if (!this.server_info.loading || this.server_info.loading === '0') {
debug('Redis server ready.');
this.on_ready();
return;
// If the master_link_status exists but the link is not up, try again after 50 ms
if (this.server_info.master_link_status && this.server_info.master_link_status !== 'up') {
this.server_info.loading_eta_seconds = 0.05;
} else {
// Eta loading should change
debug('Redis server ready.');
this.on_ready();
return;
}
}
var retry_time = +this.server_info.loading_eta_seconds * 1000;