-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: Configurable retry backoff settings when retrying API calls #4979
Conversation
@@ -16,3 +16,21 @@ func TestLookupEnvDurationOr(t *testing.T) { | |||
_ = os.Setenv("FOO", "1h") | |||
assert.Equal(t, time.Hour, LookupEnvDurationOr("FOO", time.Second), "env var value") | |||
} | |||
|
|||
func TestLookupEnvIntOr(t *testing.T) { |
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.
nice
util/retry/retry.go
Outdated
Factor: 2, | ||
var DefaultRetry wait.Backoff | ||
|
||
func init() { |
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.
I don't think you even need init now?
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.
Thanks. Removed.
Signed-off-by: terrytangyuan <terrytangyuan@gmail.com>
Signed-off-by: terrytangyuan <terrytangyuan@gmail.com>
Signed-off-by: terrytangyuan <terrytangyuan@gmail.com>
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.
good work
This allows us to configure the settings for different clusters dynamically based on conditions of those clusters (e.g. current load and available resources) when encountering transient errors.
Signed-off-by: terrytangyuan terrytangyuan@gmail.com
Checklist: