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
If the Api isn't instantiated with sleep_on_rate_limit=True, then the Api.rate_limit object doesn't actually decrement the remaining value on any of the end points, even after calling api.InitializeRateLimit(). Since that might be valuable information, it seems like we should retain it. First impression is that the offending code is L4821:
Seems to me that the if url and self.sleep_on_rate_limit check should be if url and self.rate_limit and the if limit.remaining should be if limit.remaining and self.sleep_on_rate_limit so that if the user wants to have access to the rate_limit object, they can do so by calling api.InitializeRateLimit() and then they'd have access to the rate_limit object and it would properly keep track of its resource limits.
The text was updated successfully, but these errors were encountered:
# could just be if url and self.rate_limit:ifurlandself.sleep_on_rate_limitandself.rate_limit:
limit=resp.headers.get('x-rate-limit-limit', 0)
remaining=resp.headers.get('x-rate-limit-remaining', 0)
reset=resp.headers.get('x-rate-limit-reset', 0)
self.rate_limit.set_limit(url, limit, remaining, reset)
If the Api isn't instantiated with
sleep_on_rate_limit=True
, then theApi.rate_limit
object doesn't actually decrement theremaining
value on any of the end points, even after callingapi.InitializeRateLimit()
. Since that might be valuable information, it seems like we should retain it. First impression is that the offending code is L4821:Seems to me that the
if url and self.sleep_on_rate_limit
check should beif url and self.rate_limit
and theif limit.remaining
should beif limit.remaining and self.sleep_on_rate_limit
so that if the user wants to have access to therate_limit
object, they can do so by callingapi.InitializeRateLimit()
and then they'd have access to therate_limit
object and it would properly keep track of its resource limits.The text was updated successfully, but these errors were encountered: