From 33ed1a426da493b4fd5a6a177007d38d7e1c6770 Mon Sep 17 00:00:00 2001 From: antirez Date: Sun, 1 Nov 2009 13:43:34 +0100 Subject: [PATCH] another fix for append only mode, now read-only operations are not appended --- redis.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);