public long delayBeforeNextRetry ( int retriesAttempted ) { if ( retriesAttempted < 1 ) { return initialDelay ; } if ( retriesAttempted > 63 ) { return maxDelay ; } long multiplier = ( ( long ) 1 << ( retriesAttempted - 1 ) ) ; if ( multiplier > Long . MAX_VALUE / delayInterval ) { return maxDelay ; } long delay = multiplier * delayInterval ; delay = Math . min ( delay , maxDelay ) ; return delay ; }
Returns the delay before the next attempt .