Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement WithInfiniteRetry() option #38

Merged
merged 5 commits into from Dec 13, 2023
Merged

Conversation

maximebeckman
Copy link
Contributor

@maximebeckman maximebeckman commented Dec 5, 2023

Hi,
First of all, thank you very much for this library that I'm using.
I'm submitting this pull request to you, which adds a feature I need in some of my projects, namely the ability to retry indefinitely.
Due to transactional constraints, in some cases, I cannot afford for a transaction not to be executed, and I believe that using your retrier coupled with good monitoring should handle the job more cleanly than a panicOnError().

That's why the request includes the following modifications:

  • Offer the possibility to retry indefinitely with the last backoff duration set
  • Works with any backoff duration strategy
  • Add a 'retries' parameters to the function passed into RunCtx() args, so that the called function know the number of current retries

lbcPolo and others added 2 commits December 4, 2023 19:17
- Offer the possibility to retry indefinitely with the last backoff duration set
- Works with any backoff duration strategy
- Add a 'retries' parameters to the function passed into RunCtx() args, so that the called function know the number of current retries
go.mod Outdated Show resolved Hide resolved
retrier/retrier.go Outdated Show resolved Hide resolved
@maximebeckman
Copy link
Contributor Author

Hey @eapache 👋
Thanks for your feedback, I've taken it into account and update the PR 👍

retrier/retrier.go Outdated Show resolved Hide resolved
@eapache
Copy link
Owner

eapache commented Dec 12, 2023

Minor nits, but mostly looks good to me now. Thanks!

@eapache eapache merged commit 27a8f90 into eapache:main Dec 13, 2023
2 checks passed
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.

None yet

3 participants