Browse Source

Add hit global ratelimit warning

pull/10287/head
imp 2 days ago
committed by GitHub
parent
commit
60399e692b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      discord/http.py

4
discord/http.py

@ -688,7 +688,9 @@ class HTTPClient:
# Global rate limit 429 wont have ratelimit headers (also can't tell if it's one-shot)
elif response.headers.get('X-RateLimit-Global'):
self.global_reset_at = self.loop.time() + float(response.headers['Retry-After'])
retry_after: float = float(response.headers['Retry-After'])
_log.warning('Global rate limit has been hit. Retrying in %.2f seconds.', retry_after)
self.global_reset_at = self.loop.time() + retry_after
# Endpoint does not have ratelimit headers; it's one-shot.
else:

Loading…
Cancel
Save