]> git.saurik.com Git - redis.git/commitdiff
another fix for append only mode, now read-only operations are not appended
authorantirez <antirez@gmail.com>
Sun, 1 Nov 2009 12:43:34 +0000 (13:43 +0100)
committerantirez <antirez@gmail.com>
Sun, 1 Nov 2009 12:43:34 +0000 (13:43 +0100)
redis.c

diff --git a/redis.c b/redis.c
index 38b0b686745d70722d36492937e5dfbacb3437c6..f0711f801da70f1c3395524278c9c89890a1a672 100644 (file)
--- 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);