X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/a9b18e54d4e348dd678a396cc8691dd693687de7..26b3366993f566b438049765d65c51db056fcffa:/src/redis.c diff --git a/src/redis.c b/src/redis.c index 9312ce4b..21a5bd19 100644 --- a/src/redis.c +++ b/src/redis.c @@ -633,14 +633,10 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) { } } - /* Check if we should connect to a MASTER */ - if (server.replstate == REDIS_REPL_CONNECT && !(loops % 10)) { - redisLog(REDIS_NOTICE,"Connecting to MASTER..."); - if (syncWithMaster() == REDIS_OK) { - redisLog(REDIS_NOTICE,"MASTER <-> SLAVE sync succeeded"); - if (server.appendonly) rewriteAppendOnlyFileBackground(); - } - } + /* Replication cron function -- used to reconnect to master and + * to detect transfer failures. */ + if (!(loops % 10)) replicationCron(); + return 100; }