Skip to content

Commit

Permalink
Support query timeout = 0
Browse files Browse the repository at this point in the history
In RediSearch query timeout = 0 means unlimited timeout.
In the current implementation, the query timeout is only updated `if timeout` which in case of 0, translates to false.
Since the default timeout of the `query` class is None, replacing the condition with `if self._timeout is not None` will also work for 0.
If the parameter is not a positive integer, redis server will raise an exception.

related issue: redis#2928 redis#2839
  • Loading branch information
meiravgri committed Sep 12, 2023
1 parent 1596ac6 commit b7e52cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion redis/commands/search/query.py
Expand Up @@ -194,7 +194,7 @@ def _get_args_tags(self):
args += self._ids
if self._slop >= 0:
args += ["SLOP", self._slop]
if self._timeout:
if self._timeout is not None:
args += ["TIMEOUT", self._timeout]
if self._in_order:
args.append("INORDER")
Expand Down

0 comments on commit b7e52cb

Please sign in to comment.