Commit 26751075 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

utils: Fix retry delay calculator



Before this patch, it would always sleep for at least
the time specified as the upper limit. Now it actually
limits the sleep time.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 72456eb2
...@@ -2107,7 +2107,7 @@ class _RetryDelayCalculator(object): ...@@ -2107,7 +2107,7 @@ class _RetryDelayCalculator(object):
# Update for next run # Update for next run
if self._limit is None or self._next < self._limit: if self._limit is None or self._next < self._limit:
self._next = max(self._limit, self._next * self._factor) self._next = min(self._limit, self._next * self._factor)
return current return current
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment