Skip to content

Commit

Permalink
refactor: updated backoff logic
Browse files Browse the repository at this point in the history
  • Loading branch information
MountainGod2 committed Apr 15, 2024
1 parent f5e6240 commit fb1b171
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/chaturbate_poller/chaturbate_poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,20 @@ async def __aexit__(
wait_gen=constant,
interval=2,
jitter=None,
exception=httpx.ReadError,
exception=(httpx.ReadError, httpx.HTTPStatusError),
max_tries=10,
on_giveup=giveup_handler,
on_backoff=backoff_handler,
)
@on_exception(
wait_gen=expo,
jitter=None,
factor=1.25,
base=1.25,
factor=5,
exception=httpx.HTTPStatusError,
giveup=lambda retry: not need_retry(retry),
on_giveup=giveup_handler,
max_tries=5,
max_tries=6,
on_backoff=backoff_handler,
)
async def fetch_events(self, url: str | None = None) -> EventsAPIResponse:
Expand Down

0 comments on commit fb1b171

Please sign in to comment.