Skip to content

Commit

Permalink
Fix tests on 32bit arch
Browse files Browse the repository at this point in the history
Closes: go-resty#386
  • Loading branch information
creekorful committed Nov 10, 2020
1 parent 0de0d7e commit bef33d0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions retry.go
Expand Up @@ -167,11 +167,8 @@ defaultCase:
capLevel := float64(max)

temp := math.Min(capLevel, base*math.Exp2(float64(attempt)))
ri := int(temp / 2)
if ri <= 0 {
ri = maxInt // max int for arch 386
}
result := time.Duration(math.Abs(float64(ri + rand.Intn(ri))))
ri := int64(temp / 2)
result := time.Duration(math.Abs(float64(ri + rand.Int63n(ri))))

if result < min {
result = min
Expand Down

0 comments on commit bef33d0

Please sign in to comment.