mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Only defer the lock if we're pre-emptively rate limiting.
If a 429 was already hit somehow then we're no longer pre-emptively rate limiting and we're going to end up having a race condition in the lock/unlock cycle.
This commit is contained in:
parent
2a6c240271
commit
3558a0db27
@ -154,7 +154,7 @@ class HTTPClient:
|
||||
|
||||
# check if we have rate limit header information
|
||||
remaining = r.headers.get('X-Ratelimit-Remaining')
|
||||
if remaining == '0':
|
||||
if remaining == '0' and r.status != 429:
|
||||
# we've depleted our current bucket
|
||||
if header_bypass_delay is None:
|
||||
now = parsedate_to_datetime(r.headers['Date'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user