diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tracking.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tracking.c b/src/tracking.c index 3d207563f..775eea684 100644 --- a/src/tracking.c +++ b/src/tracking.c @@ -393,10 +393,10 @@ void trackingInvalidateKey(client *c, robj *keyobj, int bcast) { continue; } - /* If target is current client, we need schedule key invalidation. + /* If target is current client and it's executing a command, we need schedule key invalidation. * As the invalidation messages may be interleaved with command - * response and should after command response */ - if (target == server.current_client){ + * response and should after command response. */ + if (target == server.current_client && (server.current_client->flags & CLIENT_EXECUTING_COMMAND)) { incrRefCount(keyobj); listAddNodeTail(server.tracking_pending_keys, keyobj); } else { |