diff options
author | antirez <antirez@gmail.com> | 2013-01-23 16:38:47 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2013-01-28 13:14:39 +0100 |
commit | 08d8bb57df97f9ab206dbc229a64c4f9fe7ffc4d (patch) | |
tree | 4c2f29ee477b826987934ea86f36ef34bf25d45d /src/notify.c | |
parent | 4cdbce341ebff64d392a42011f4a9258f8aa834f (diff) | |
download | redis-08d8bb57df97f9ab206dbc229a64c4f9fe7ffc4d.tar.gz |
Two fixes to initial keyspace notifications API.
Diffstat (limited to 'src/notify.c')
-rw-r--r-- | src/notify.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); |