-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support timeout = 0 in search query #2934
Conversation
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
Raise the exception when the timeout is set instead of when the query is performed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov ReportPatch coverage:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #2934 +/- ##
==========================================
- Coverage 91.28% 91.27% -0.01%
==========================================
Files 126 126
Lines 32398 32400 +2
==========================================
- Hits 29575 29574 -1
- Misses 2823 2826 +3
☔ View full report in Codecov by Sentry. |
closes #2839 |
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 thequery
class is None, replacing the condition withif 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: #2839
Pull Request check-list
Please make sure to review and check all of these items:
NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.
Description of change
Please provide a description of the change here.