Skip to content

Commit

Permalink
chore: Comment retry delay backoff calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-miller committed Nov 26, 2024
1 parent 05ddc28 commit 4b20d81
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions brozzler/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,8 @@ def brozzle_site(self, browser, site):
"unexpected exception site=%r page=%r", site, page, exc_info=True
)
if page:
# Calculate backoff in seconds based on number of failed attempts.
# Minimum of 60, max of 135 giving delays of 60, 90, 135, 135...
retry_delay = min(135, 60 * (1.5**page.failed_attempts))
page.retry_after = doublethink.utcnow() + datetime.timedelta(
seconds=retry_delay
Expand Down

0 comments on commit 4b20d81

Please sign in to comment.