Skip to content

Commit

Permalink
Do not retry 429 (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
fustom authored May 21, 2024
1 parent d26650d commit 87072cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ariston/ariston_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,8 @@ def __request(
raise Exception("Invalid token")
case 404:
return None
case 429:
raise RequestFailedError(response.status_code, response.text)
case _:
if not is_retry:
time.sleep(5)
Expand Down Expand Up @@ -898,6 +900,8 @@ async def __async_request(
raise Exception("Invalid token")
case 404:
return None
case 429:
raise RequestFailedError(response.status_code, response.text)
case _:
if not is_retry:
await asyncio.sleep(5)
Expand Down

0 comments on commit 87072cb

Please sign in to comment.