Advertisement
Guest User

Untitled

a guest
May 17th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. def retry(exception, interval=1, retries=10, backoff_rate=2,
  2. - wait_random=False):
  3. + wait_random=False, max_wait=None):
  4. """A wrapper around retrying library.
  5.  
  6. This decorator allows to log and to check 'retries' input param.
  7. @@ -436,6 +436,9 @@ def retry(exception, interval=1, retries=10, backoff_rate=2,
  8. else:
  9. wait_val = wait_for * 1000.0
  10.  
  11. + if max_wait:
  12. + wait_val = min(wait_for, max_wait)
  13. +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement