DATAREDIS-1138 - Fix detection whether XREAD is blocking.
We now correctly check if a BLOCK option is configured using a timeout of zero or higher. Previously we only checked if the configured value is greater than zero and didn't consider that a timeout of zero blocks indefinitely. Original Pull Request: #528
This commit is contained in:
committed by
Christoph Strobl
parent
37ff71c320
commit
15259fd355
@@ -207,7 +207,7 @@ class LettuceReactiveStreamCommands implements ReactiveStreamCommands {
|
||||
|
||||
StreamReadOptions readOptions = command.getReadOptions();
|
||||
|
||||
if (readOptions.getBlock() != null && readOptions.getBlock() > 0) {
|
||||
if (readOptions.getBlock() != null && readOptions.getBlock() >= 0) {
|
||||
return new CommandResponse<>(command, connection.executeDedicated(cmd -> doRead(command, readOptions, cmd)));
|
||||
}
|
||||
|
||||
|
||||
@@ -472,7 +472,7 @@ class LettuceStreamCommands implements RedisStreamCommands {
|
||||
}
|
||||
|
||||
private static boolean isBlocking(StreamReadOptions readOptions) {
|
||||
return readOptions.getBlock() != null && readOptions.getBlock() > 0;
|
||||
return readOptions.getBlock() != null && readOptions.getBlock() >= 0;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
Reference in New Issue
Block a user