Skip to content

Commit

Permalink
feat: retry http requests that fail with a 503 status (#2395)
Browse files Browse the repository at this point in the history

Signed-off-by: DarkSoul <83767949+D4rk-S0ul@users.noreply.github.com>
Co-authored-by: plun1331 <plun1331@gmail.com>
Co-authored-by: Lala Sabathil <lala@pycord.dev>
  • Loading branch information
3 people committed Mar 22, 2024
1 parent 7a6fcda commit 532db98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ These changes are available on the `master` branch, but have not yet been releas

- Changed the type of `Guild.bitrate_limit` to `int`.
([#2387](https://github.com/Pycord-Development/pycord/pull/2387))
- HTTP requests that fail with a 503 status are now re-tried.
([#2395](https://github.com/Pycord-Development/pycord/pull/2395))

## [2.5.0] - 2024-03-02

Expand Down
4 changes: 2 additions & 2 deletions discord/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ async def request(

continue

# we've received a 500, 502, or 504, unconditional retry
if response.status in {500, 502, 504}:
# we've received a 500, 502, 503, or 504, unconditional retry
if response.status in {500, 502, 503, 504}:
await asyncio.sleep(1 + tries * 2)
continue

Expand Down

0 comments on commit 532db98

Please sign in to comment.