Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
  • Loading branch information
sywhang and abhinav authored Feb 13, 2023
1 parent 8b91807 commit 717ca8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (o *opts) validate() error {
if o.maxRetries < 0 {
return errors.New("maxRetryAttempts should be greater than 0")
}
if o.maxSleep < time.Duration(0) {
if o.maxSleep <= 0 {
return errors.New("maxSleepInterval should be greater than 0s")
}
return nil
Expand Down Expand Up @@ -108,7 +108,7 @@ func IgnoreCurrent() Option {
}

// MaxSleepInterval sets the maximum sleep time in-between each retry attempt.
// The sleep duration is growing in an exponential backoff but limits to the value we set.
// The sleep duration grows in an exponential backoff, to a maximum of the value specified here.
// If not configured, default to 100 microseconds.
func MaxSleepInterval(d time.Duration) Option {
return optionFunc(func(opts *opts) {
Expand Down

0 comments on commit 717ca8e

Please # to comment.