Skip to content

Commit

Permalink
Fixbug for Backoff when many attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy authored May 6, 2021
1 parent 154798c commit da0be99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ class _Backoff {
/// @api public
///
num get duration {
var ms = _ms * math.pow(_factor, attempts++);
var ms = math.min(_ms * math.pow(_factor, attempts++), 1e100);
if (_jitter > 0) {
var rand = math.Random().nextDouble();
var deviation = (rand * _jitter * ms).floor();
Expand Down

0 comments on commit da0be99

Please sign in to comment.