From c3ee5feb08e9aa5bd941da432beddd4ec88a0318 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 23 Jan 2013 16:38:47 +0100 Subject: [PATCH] Two fixes to initial keyspace notifications API. --- src/notify.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/notify.c b/src/notify.c index 70c965663..fc462d80f 100644 --- a/src/notify.c +++ b/src/notify.c @@ -47,6 +47,8 @@ void notifyKeyspaceEvent(char *event, robj *key, int dbid) { char buf[24]; robj *chan1, *chan2, *eventobj; + if (!server.notify_keyspace_events) return; + /* The prefix of the two channels is identical if not for * 'keyspace' that is 'keyevent' in the event channel name, so * we build a single prefix and overwrite 'event' with 'space'. */ @@ -62,7 +64,7 @@ void notifyKeyspaceEvent(char *event, robj *key, int dbid) { /* The keyspace channel name has a trailing key name, while * the keyevent channel name has a trailing event name. */ keyspace_chan = sdscatsds(keyspace_chan, key->ptr); - keyevent_chan = sdscatsds(keyspace_chan, eventobj->ptr); + keyevent_chan = sdscatsds(keyevent_chan, eventobj->ptr); chan1 = createObject(REDIS_STRING, keyspace_chan); chan2 = createObject(REDIS_STRING, keyevent_chan);