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
3163c9cb
Unverified
Commit
3163c9cb
authored
Mar 22, 2018
by
Salvatore Sanfilippo
Committed by
GitHub
Mar 22, 2018
Browse files
Merge pull request #4781 from guybe7/block_list_notify
Make blocking list commands send keyspace notifications
parents
6c4cb167
fa00e20b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/blocked.c
View file @
3163c9cb
...
@@ -283,6 +283,7 @@ void handleClientsBlockedOnKeys(void) {
...
@@ -283,6 +283,7 @@ void handleClientsBlockedOnKeys(void) {
if
(
listTypeLength
(
o
)
==
0
)
{
if
(
listTypeLength
(
o
)
==
0
)
{
dbDelete
(
rl
->
db
,
rl
->
key
);
dbDelete
(
rl
->
db
,
rl
->
key
);
notifyKeyspaceEvent
(
NOTIFY_GENERIC
,
"del"
,
rl
->
key
,
rl
->
db
->
id
);
}
}
/* We don't call signalModifiedKey() as it was already called
/* We don't call signalModifiedKey() as it was already called
* when an element was pushed on the list. */
* when an element was pushed on the list. */
...
...
src/t_list.c
View file @
3163c9cb
...
@@ -639,6 +639,10 @@ int serveClientBlockedOnList(client *receiver, robj *key, robj *dstkey, redisDb
...
@@ -639,6 +639,10 @@ int serveClientBlockedOnList(client *receiver, robj *key, robj *dstkey, redisDb
addReplyMultiBulkLen
(
receiver
,
2
);
addReplyMultiBulkLen
(
receiver
,
2
);
addReplyBulk
(
receiver
,
key
);
addReplyBulk
(
receiver
,
key
);
addReplyBulk
(
receiver
,
value
);
addReplyBulk
(
receiver
,
value
);
/* Notify event. */
char
*
event
=
(
where
==
LIST_HEAD
)
?
"lpop"
:
"rpop"
;
notifyKeyspaceEvent
(
NOTIFY_LIST
,
event
,
key
,
receiver
->
db
->
id
);
}
else
{
}
else
{
/* BRPOPLPUSH */
/* BRPOPLPUSH */
robj
*
dstobj
=
robj
*
dstobj
=
...
@@ -663,6 +667,9 @@ int serveClientBlockedOnList(client *receiver, robj *key, robj *dstkey, redisDb
...
@@ -663,6 +667,9 @@ int serveClientBlockedOnList(client *receiver, robj *key, robj *dstkey, redisDb
db
->
id
,
argv
,
3
,
db
->
id
,
argv
,
3
,
PROPAGATE_AOF
|
PROPAGATE_AOF
|
PROPAGATE_REPL
);
PROPAGATE_REPL
);
/* Notify event ("lpush" was notified by rpoplpushHandlePush). */
notifyKeyspaceEvent
(
NOTIFY_LIST
,
"rpop"
,
key
,
receiver
->
db
->
id
);
}
else
{
}
else
{
/* BRPOPLPUSH failed because of wrong
/* BRPOPLPUSH failed because of wrong
* destination type. */
* destination type. */
...
...
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