make ExponentialRetryTimeout.seconds_to_wait always return an int
This commit is contained in:
parent
358973c231
commit
cc28e9cd69
|
@ -52,12 +52,12 @@ class ExponentialRetryTimeout(object):
|
|||
done.
|
||||
'''
|
||||
key = self.key(keys)
|
||||
if not self.duration:
|
||||
return 0
|
||||
now = time.time()
|
||||
what = cache.get(key)
|
||||
if what and what[1] > now:
|
||||
return what[1] - now
|
||||
if self.duration:
|
||||
now = time.time()
|
||||
what = cache.get(key)
|
||||
if what and what[1] > now:
|
||||
return what[1] - now
|
||||
return 0
|
||||
|
||||
def success(self, *keys):
|
||||
'''Signal an action success, delete exponential backoff cache.
|
||||
|
|
Loading…
Reference in New Issue