diff options
| author | Rapptz <[email protected]> | 2017-02-08 03:47:35 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-02-08 03:47:53 -0500 |
| commit | 3558a0db27324d801a983a53bf65dc3f48e23fa2 (patch) | |
| tree | 9b544e6866e4dc5f47be2155488dc4720c47b618 | |
| parent | [commands] Better support for retrieving children commands. (diff) | |
| download | discord.py-3558a0db27324d801a983a53bf65dc3f48e23fa2.tar.xz discord.py-3558a0db27324d801a983a53bf65dc3f48e23fa2.zip | |
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.
| -rw-r--r-- | discord/http.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/discord/http.py b/discord/http.py index f55d43a6..24510be4 100644 --- a/discord/http.py +++ b/discord/http.py @@ -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']) |