summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/blocked.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/blocked.c b/src/blocked.c
index 5f4fa9ec2..179bf3556 100644
--- a/src/blocked.c
+++ b/src/blocked.c
@@ -480,6 +480,10 @@ void serveClientsBlockedOnStreamKey(robj *o, readyList *rl) {
void serveClientsBlockedOnKeyByModule(readyList *rl) {
dictEntry *de;
+ /* Optimization: If no clients are in type BLOCKED_MODULE,
+ * we can skip this loop. */
+ if (!server.blocked_clients_by_type[BLOCKED_MODULE]) return;
+
/* We serve clients in the same order they blocked for
* this key, from the first blocked to the last. */
de = dictFind(rl->db->blocking_keys,rl->key);