diff --git a/redis.c b/redis.c index 1aae04c93544ef64dc16542efd918319cb30ba4e..3510798df6fc4c68c198c3f14575c6d38fb76153 100644 --- a/redis.c +++ b/redis.c @@ -622,6 +622,7 @@ static void freePubsubPattern(void *p); static int listMatchPubsubPattern(void *a, void *b); static int compareStringObjects(robj *a, robj *b); static void usage(); +static int rewriteAppendOnlyFileBackground(void); static void authCommand(redisClient *c); static void pingCommand(redisClient *c); @@ -1516,6 +1517,7 @@ static int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientD redisLog(REDIS_NOTICE,"Connecting to MASTER..."); if (syncWithMaster() == REDIS_OK) { redisLog(REDIS_NOTICE,"MASTER <-> SLAVE sync succeeded"); + if (server.appendonly) rewriteAppendOnlyFileBackground(); } } return 100;