aboutsummaryrefslogtreecommitdiff
path: root/discord/http.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-02-08 03:47:35 -0500
committerRapptz <[email protected]>2017-02-08 03:47:35 -0500
commitf5b455c119d40d8c58b7781b22b8c225fc9d1786 (patch)
tree83ebb39f2eb599309415bd6e0e88e034e1ee2995 /discord/http.py
parent[commands] Better support for retrieving children commands. (diff)
downloaddiscord.py-f5b455c119d40d8c58b7781b22b8c225fc9d1786.tar.xz
discord.py-f5b455c119d40d8c58b7781b22b8c225fc9d1786.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.
Diffstat (limited to 'discord/http.py')
-rw-r--r--discord/http.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/discord/http.py b/discord/http.py
index e660f6cb..0150a9bd 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'])