-
Notifications
You must be signed in to change notification settings - Fork 45
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(exp): add retry package #479
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #479 +/- ##
==========================================
+ Coverage 71.56% 71.65% +0.08%
==========================================
Files 45 46 +1
Lines 3904 3923 +19
==========================================
+ Hits 2794 2811 +17
- Misses 696 698 +2
Partials 414 414 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have an example PR in any integration that uses this?
Policy func(err error) bool | ||
} | ||
|
||
func Retry[T any](opts Opts, request func() (T, *hcloud.Response, error)) (T, *hcloud.Response, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add examples for these to showcase how one can use them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, I would love to, but:
- Terraform is still using v1, so we don't have the experimental package https://github.com/search?q=repo%3Ahetznercloud%2Fterraform-provider-hcloud+ErrorCodeLocked&type=code
- HCCM is blocked by the prometheus go library version conflict https://github.com/search?q=repo%3Ahetznercloud%2Fhcloud-cloud-controller-manager+ErrorCodeLocked&type=code
- The rest of the integrations don't seem to have a need for it yet.
Let's wait until we find a use case that we can implement and test against.
ac6a961
to
2fc0a6d
Compare
This PR has been marked as stale because it has not had recent activity. The bot will close the PR if no further action occurs. |
Adds a few retry utilities that may be used in certain context to retry failed requests based on a policy.
Related to #470