Skip to content

Conversation

@mawelborn
Copy link
Contributor

Refactors and enhances the @retry() decorator with:

  • Best practices for exponential backoff and jitter
    • Configurable retry count, base wait time, backoff multiplier, and jitter multiplier
    • Reasonable defaults that retry 4 times over the course of ~2 minutes
      • With 1, 4, 16, and 64 second waits (+ up to 50% jitter)
  • Cleaner function signature for specifying errors to retry on
  • More thorough type checks
  • Unshadows the retry module

@mawelborn
Copy link
Contributor Author

Merging this as it's been tested in various projects and I'd like to use it in another PR.

@mawelborn mawelborn merged commit 16c3444 into main Jan 13, 2025
9 checks passed
@mawelborn mawelborn deleted the mawelborn/retry-refactor branch January 13, 2025 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant