mirror of
https://github.com/fluencelabs/redis
synced 2025-06-15 02:01:21 +00:00
first attempt to non blocking implementation of slave replication and SYNC bulk data download. Never compiled so far...
This commit is contained in:
12
src/redis.c
12
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(void);
|
||||
|
||||
return 100;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user