-
Notifications
You must be signed in to change notification settings - Fork 718
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
Allow to override default retry wait times for Client #66
Conversation
Codecov Report
@@ Coverage Diff @@
## master #66 +/- ##
==========================================
+ Coverage 96.74% 96.78% +0.03%
==========================================
Files 11 11
Lines 892 902 +10
==========================================
+ Hits 863 873 +10
Misses 15 15
Partials 14 14
Continue to review full report at Codecov.
|
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.
Thank you for effort and time. Implementation looks perfect.
I think we have to add info about these defaults in godoc or Readme.md. What do you think?
defaultWaitTime = time.Duration(100) * time.Millisecond
defaultMaxWaitTime = time.Duration(2000) * time.Millisecond
@jeevatkm Makes sense. I'll add some info on retries to readme. |
Thank you @bak1an. |
@bak1an Shall I go ahead and merge this PR or wait for your readme changes? Please let me know. |
Sorry for the delay, Added some retry usage doc and mentioned delay defaults in doc. |
Thank you @bak1an, I appreciate it. |
This resolves #64
Changes made here:
Changing retry wait time options to have
time.Duration
type instead of ofint
holding milliseconds.Adding
RetryWaitTime
andRetryMaxWaitTime
fields toClient
along with chaining setters.A condition to make sure
Backoff
always sleeps at leastWaitTime
duration. Before this change it could sleep less than this due to jitter we have there. Especially before the very first retry, the sleep duration was always somewhere betweenWaitTime / 2
andWaitTime
.Test to make sure overridden wait times are actually used.