sunng87 / diehard

Clojure resilience library for flexible retry, circuit breaker and rate limiter
Eclipse Public License 2.0
330 stars 27 forks source link

:backoff-ms documentation does not match failsafe docs #29

Closed hukka closed 4 years ago

hukka commented 4 years ago

The current docs say

the delay for nth retry will be (max (* initial-delay-ms n) max-delay-ms)

while failsafe says on http://jodah.net/failsafe/javadoc/net/jodah/failsafe/RetryPolicy.html#withBackoff-long-long-java.time.temporal.ChronoUnit-

Sets the delay between retries, exponentially backing off to the maxDelay and multiplying successive delays by a factor of 2.

so the correct formula would be min(max-delay-ms, (initial-delay-ms × 2^(n-1)))

sunng87 commented 4 years ago

Thanks! Fixed in 98a0743