166
167
// Bail out if the next interval is smaller than initial retry interval
169
>
if nextDuration < p.initialInterval {
170
return done
171
}
172
174
>
175
>
return time.Duration(nextInterval)
176
}
177
178
>
func (p *ExponentialRetryPolicy) addJitter(nextInterval float64) float64 {
retrypolicy.go
179
>
// add jitter to avoid global synchronization
180
>
jitterPortion := max(
181
>
// Prevent overflow
182
>
int(0.2*nextInterval), 1)
183
>
nextInterval = nextInterval*0.8 + float64(getJitterRand().Intn(jitterPortion))
184
>
return nextInterval
185
>
}
186
187
func (r *disabledRetryPolicyImpl) ComputeNextDelay(_ time.Duration, _ int, _ error) time.Duration {