From 2675107567e5b3dca6daf9246c692565b17e70eb Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Wed, 3 Feb 2010 13:18:01 +0100 Subject: [PATCH] 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: Michael Hanselmann <hansmi@google.com> Reviewed-by: Iustin Pop <iustin@google.com> --- lib/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils.py b/lib/utils.py index 1abec0ef2..50ad64fcf 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -2107,7 +2107,7 @@ class _RetryDelayCalculator(object): # Update for next run 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 -- GitLab