summaryrefslogtreecommitdiffstats
path: root/src/blocked.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/blocked.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/blocked.c b/src/blocked.c
index 6ad4667..7b48fca 100644
--- a/src/blocked.c
+++ b/src/blocked.c
@@ -370,7 +370,12 @@ void blockForKeys(client *c, int btype, robj **keys, int numkeys, mstime_t timeo
list *l;
int j;
- c->bstate.timeout = timeout;
+ if (!(c->flags & CLIENT_REPROCESSING_COMMAND)) {
+ /* If the client is re-processing the command, we do not set the timeout
+ * because we need to retain the client's original timeout. */
+ c->bstate.timeout = timeout;
+ }
+
for (j = 0; j < numkeys; j++) {
/* If the key already exists in the dictionary ignore it. */
if (!(client_blocked_entry = dictAddRaw(c->bstate.keys,keys[j],NULL))) {
@@ -392,7 +397,6 @@ void blockForKeys(client *c, int btype, robj **keys, int numkeys, mstime_t timeo
listAddNodeTail(l,c);
dictSetVal(c->bstate.keys,client_blocked_entry,listLast(l));
-
/* We need to add the key to blocking_keys_unblock_on_nokey, if the client
* wants to be awakened if key is deleted (like XREADGROUP) */
if (unblock_on_nokey) {