Skip to content

Commit

Permalink
fix: delay logic
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnasism committed Mar 16, 2024
1 parent 07da804 commit efbc89c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion retry_later/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async def wrapper(
if retries >= max_retries:
raise e
delay = retry_interval * (backoff**retries) + random.choice(range(0, max_jitter + 1))
delay = min(max(0, max_delay), delay)
delay = delay if max_delay == -1 else min(max_delay, delay)
logging.error(f"[retry later] Retrying in {delay}s due to {e}")
await asyncio.sleep(delay)

Expand Down

0 comments on commit efbc89c

Please sign in to comment.