getDelayForAttempt method

Duration getDelayForAttempt(
  1. int attempt
)

Calculate delay for a specific attempt (with exponential backoff)

Implementation

Duration getDelayForAttempt(int attempt) {
  final multiplier = backoffMultiplier > 1.0
      ? (backoffMultiplier * attempt).round()
      : 1.0;
  return Duration(
    milliseconds: (delay.inMilliseconds * multiplier).round(),
  );
}