aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkhazhyk <[email protected]>2017-07-22 19:45:32 -0700
committerkhazhyk <[email protected]>2017-07-22 20:10:25 -0700
commit2850995062b8dbefac70bf56aecc2ceb429cf974 (patch)
treeeb63dd558632e257388f9606083d53f7db1fb6dd
parentFix waiting for resume when calling stop() on AudioPlayer (diff)
downloaddiscord.py-2850995062b8dbefac70bf56aecc2ceb429cf974.tar.xz
discord.py-2850995062b8dbefac70bf56aecc2ceb429cf974.zip
Retry on 500 in HTTPClient.request
Discord official client retries on 500, so worst case scenario, we're not any worse than the official client which seriously outnumbers us.
-rw-r--r--discord/http.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/http.py b/discord/http.py
index e59ea0e2..2d3bb8e1 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -193,8 +193,8 @@ class HTTPClient:
continue
- # we've received a 502, unconditional retry
- if r.status == 502 and tries <= 5:
+ # we've received a 500 or 502, unconditional retry
+ if r.status in {500, 502} and tries <= 5:
yield from asyncio.sleep(1 + tries * 2, loop=self.loop)
continue