Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
08d8bb57
Commit
08d8bb57
authored
Jan 23, 2013
by
antirez
Browse files
Two fixes to initial keyspace notifications API.
parent
4cdbce34
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/notify.c
View file @
08d8bb57
...
@@ -47,6 +47,8 @@ void notifyKeyspaceEvent(char *event, robj *key, int dbid) {
...
@@ -47,6 +47,8 @@ void notifyKeyspaceEvent(char *event, robj *key, int dbid) {
char
buf
[
24
];
char
buf
[
24
];
robj
*
chan1
,
*
chan2
,
*
eventobj
;
robj
*
chan1
,
*
chan2
,
*
eventobj
;
if
(
!
server
.
notify_keyspace_events
)
return
;
/* The prefix of the two channels is identical if not for
/* The prefix of the two channels is identical if not for
* 'keyspace' that is 'keyevent' in the event channel name, so
* 'keyspace' that is 'keyevent' in the event channel name, so
* we build a single prefix and overwrite 'event' with 'space'. */
* we build a single prefix and overwrite 'event' with 'space'. */
...
@@ -62,7 +64,7 @@ void notifyKeyspaceEvent(char *event, robj *key, int dbid) {
...
@@ -62,7 +64,7 @@ void notifyKeyspaceEvent(char *event, robj *key, int dbid) {
/* The keyspace channel name has a trailing key name, while
/* The keyspace channel name has a trailing key name, while
* the keyevent channel name has a trailing event name. */
* the keyevent channel name has a trailing event name. */
keyspace_chan
=
sdscatsds
(
keyspace_chan
,
key
->
ptr
);
keyspace_chan
=
sdscatsds
(
keyspace_chan
,
key
->
ptr
);
keyevent_chan
=
sdscatsds
(
key
space
_chan
,
eventobj
->
ptr
);
keyevent_chan
=
sdscatsds
(
key
event
_chan
,
eventobj
->
ptr
);
chan1
=
createObject
(
REDIS_STRING
,
keyspace_chan
);
chan1
=
createObject
(
REDIS_STRING
,
keyspace_chan
);
chan2
=
createObject
(
REDIS_STRING
,
keyevent_chan
);
chan2
=
createObject
(
REDIS_STRING
,
keyevent_chan
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment