X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/4abd096f5188448a2c0e75511a049b3a3fd8e9b1..16cd4acdeed9f38802606bfad206b632d4cb5039:/src/redis.c?ds=sidebyside diff --git a/src/redis.c b/src/redis.c index e7351b6e..8fbed746 100644 --- a/src/redis.c +++ b/src/redis.c @@ -901,6 +901,7 @@ void initServerConfig() { server.replstate = REDIS_REPL_NONE; server.repl_syncio_timeout = REDIS_REPL_SYNCIO_TIMEOUT; server.repl_serve_stale_data = 1; + server.repl_down_since = -1; /* Double constants initialization */ R_Zero = 0.0; @@ -1522,6 +1523,12 @@ sds genRedisInfoString(char *section) { (int)(time(NULL)-server.repl_transfer_lastio) ); } + + if (server.replstate != REDIS_REPL_CONNECTED) { + info = sdscatprintf(info, + "master_link_down_since_seconds:%ld\r\n", + (long)time(NULL)-server.repl_down_since); + } } info = sdscatprintf(info, "connected_slaves:%d\r\n",