retry: fix decorator
The previous one was buggy. We also must pass None to stop_max_delay and not a boolean, otherwise it fails. Change-Id: Ia0babdfbae3b6ce88ae37f79b39fc4d215801b95
This commit is contained in:
parent
27ab08c5ee
commit
5edf2b3db3
|
@ -32,11 +32,11 @@ RETRYING_KWARGS = dict(
|
|||
|
||||
|
||||
def retry(**kwargs):
|
||||
def _retry(f):
|
||||
k = RETRYING_KWARGS.copy()
|
||||
k.update(kwargs)
|
||||
return retrying.retry(**k)(f)
|
||||
return _retry
|
||||
delay = kwargs.get('stop_max_delay', None)
|
||||
kwargs['stop_max_delay'] = delay if delay not in (True, False) else None
|
||||
k = RETRYING_KWARGS.copy()
|
||||
k.update(kwargs)
|
||||
return retrying.retry(**k)
|
||||
|
||||
|
||||
Retrying = retrying.Retrying
|
||||
|
|
Loading…
Reference in New Issue