You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure how stop_max_delay is intended to work, but I would expect it would stop retry after have been retrying more than the given time with that parameter. However, actually it works very differently: it just disable retry if the script has been run for more than the given time. This can be easily reproduced with this script:
import time
import sys
from retrying import retry
def retry_on_exception(exception):
print 'Retrying....'
return True
@retry(retry_on_exception=retry_on_exception, stop_max_delay=10000, wait_fixed=1000)
def test(sleep):
time.sleep(sleep)
assert False
if __name__ == '__main__':
test(int(sys.argv[1]))
if I run
python test.py 0
you will get 10 retries, one per second, as expected. In this case, the exception is raised as soon as the script starts, that is why the problem is not seen. However, if you run
python test.py 12
(so exception will be raised 12 seconds after the script started), you won't get any retry.
The text was updated successfully, but these errors were encountered:
I am not sure how
stop_max_delay
is intended to work, but I would expect it would stop retry after have been retrying more than the given time with that parameter. However, actually it works very differently: it just disable retry if the script has been run for more than the given time. This can be easily reproduced with this script:if I run
python test.py 0
you will get 10 retries, one per second, as expected. In this case, the exception is raised as soon as the script starts, that is why the problem is not seen. However, if you run
python test.py 12
(so exception will be raised 12 seconds after the script started), you won't get any retry.
The text was updated successfully, but these errors were encountered: