From: antirez <antirez@gmail.com> Date: Sun, 1 Nov 2009 12:43:34 +0000 (+0100) Subject: another fix for append only mode, now read-only operations are not appended X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/33ed1a426da493b4fd5a6a177007d38d7e1c6770 another fix for append only mode, now read-only operations are not appended --- diff --git a/redis.c b/redis.c index 38b0b686..f0711f80 100644 --- a/redis.c +++ b/redis.c @@ -1580,9 +1580,9 @@ static int processCommand(redisClient *c) { /* Exec the command */ dirty = server.dirty; cmd->proc(c); - if (server.appendonly != 0) + if (server.appendonly && server.dirty-dirty) feedAppendOnlyFile(cmd,c->db->id,c->argv,c->argc); - if (server.dirty-dirty != 0 && listLength(server.slaves)) + if (server.dirty-dirty && listLength(server.slaves)) replicationFeedSlaves(server.slaves,cmd,c->db->id,c->argv,c->argc); if (listLength(server.monitors)) replicationFeedSlaves(server.monitors,cmd,c->db->id,c->argv,c->argc);