You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 29, 2020. It is now read-only.
According to the redis-py library documentation, scan() does no iteration itself, you are expected to use the returned cursor to fetch the remaining results manually. Line 189 seems to assume that passing a high enough count argument will ensure all results are returned, but according to the Redis documentation that is not the case.
The consequence is that _requests_in_timespan() might underestimate the number of requests in the timespan, making rate control unreliable.
A simple fix is to replace the scan() call with scan_iter(), which does ensure that the full result set is returned.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In respectful_requester.py#L189, the pattern
len(redis.scan())
is used.According to the redis-py library documentation,
scan()
does no iteration itself, you are expected to use the returned cursor to fetch the remaining results manually. Line 189 seems to assume that passing a high enoughcount
argument will ensure all results are returned, but according to the Redis documentation that is not the case.The consequence is that
_requests_in_timespan()
might underestimate the number of requests in the timespan, making rate control unreliable.A simple fix is to replace the
scan()
call withscan_iter()
, which does ensure that the full result set is returned.The text was updated successfully, but these errors were encountered: