mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
Streams: fix XREAD timeout handling, zero is valid.
This commit is contained in:
parent
2cacdcd6f8
commit
b5be5093fe
@ -398,7 +398,7 @@ void xlenCommand(client *c) {
|
|||||||
* [RETRY <milliseconds> <ttl>] STREAMS key_1 key_2 ... key_N
|
* [RETRY <milliseconds> <ttl>] STREAMS key_1 key_2 ... key_N
|
||||||
* ID_1 ID_2 ... ID_N */
|
* ID_1 ID_2 ... ID_N */
|
||||||
void xreadCommand(client *c) {
|
void xreadCommand(client *c) {
|
||||||
long long timeout = 0;
|
long long timeout = -1; /* -1 means, no BLOCK argument given. */
|
||||||
long long count = 0;
|
long long count = 0;
|
||||||
int streams_count = 0;
|
int streams_count = 0;
|
||||||
int streams_arg = 0;
|
int streams_arg = 0;
|
||||||
@ -499,7 +499,7 @@ void xreadCommand(client *c) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Block if needed. */
|
/* Block if needed. */
|
||||||
if (timeout) {
|
if (timeout != -1) {
|
||||||
/* If we are inside a MULTI/EXEC and the list is empty the only thing
|
/* If we are inside a MULTI/EXEC and the list is empty the only thing
|
||||||
* we can do is treating it as a timeout (even with timeout 0). */
|
* we can do is treating it as a timeout (even with timeout 0). */
|
||||||
if (c->flags & CLIENT_MULTI) {
|
if (c->flags & CLIENT_MULTI) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user