Skip to content

Commit

Permalink
config: use explicit int64 for random durations
Browse files Browse the repository at this point in the history
  • Loading branch information
mreiferson committed Sep 12, 2021
1 parent 37690ba commit ef4dee6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (s *FullJitterStrategy) Calculate(attempt int) time.Duration {

backoffDuration := s.cfg.BackoffMultiplier *
time.Duration(math.Pow(2, float64(attempt)))
return time.Duration(s.rng.Intn(int(backoffDuration)))
return time.Duration(s.rng.Int63n(int64(backoffDuration)))
}

func (s *FullJitterStrategy) setConfig(cfg *Config) {
Expand Down

0 comments on commit ef4dee6

Please sign in to comment.