projects
/
ganeti-local
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
72456eb
)
utils: Fix retry delay calculator
author
Michael Hanselmann
<hansmi@google.com>
Wed, 3 Feb 2010 12:18:01 +0000
(13:18 +0100)
committer
Michael Hanselmann
<hansmi@google.com>
Wed, 3 Feb 2010 13:01:10 +0000
(14:01 +0100)
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
patch
|
blob
|
history
diff --git
a/lib/utils.py
b/lib/utils.py
index
1abec0e
..
50ad64f
100644
(file)
--- 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