mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add exception logging in flaky decorator
This commit is contained in:
parent
0ba0ddf8fa
commit
982e693ef6
1 changed files with 4 additions and 1 deletions
|
@ -211,7 +211,10 @@ def flaky(caller=None, condition=True, attempts=4):
|
|||
if attempt >= attempts -1:
|
||||
raise exc
|
||||
backoff_time = attempt ** 2
|
||||
log.info('Found Exception. Waiting %s seconds to retry.', backoff_time)
|
||||
log.info(
|
||||
'Found Exception. Waiting %s seconds to retry.',
|
||||
backoff_time
|
||||
)
|
||||
time.sleep(backoff_time)
|
||||
return cls
|
||||
return wrap
|
||||
|
|
Loading…
Add table
Reference in a new issue