Skip to content

Commit 532db98

Browse files
D4rk-S0ulplun1331Lulalaby
authored
feat: retry http requests that fail with a 503 status (Pycord-Development#2395)
Signed-off-by: DarkSoul <[email protected]> Co-authored-by: plun1331 <[email protected]> Co-authored-by: Lala Sabathil <[email protected]>
1 parent 7a6fcda commit 532db98

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ These changes are available on the `master` branch, but have not yet been releas
3333

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

3739
## [2.5.0] - 2024-03-02
3840

discord/http.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ async def request(
357357

358358
continue
359359

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

0 commit comments

Comments
 (0)