Answers for "retry on exception python"

0

python retry

import time
def retry(fun, max_tries=10):
    for i in range(max_tries):
        try:
           time.sleep(0.3) 
           fun()
           break
        except Exception:
            continue
Posted by: Guest on May-21-2020
0

retry on exception python

@retry(wait_random_min=1000, wait_random_max=2000)
def wait_random_1_to_2_s():
    print("Randomly wait 1 to 2 seconds between retries")
Posted by: Guest on June-16-2021

Python Answers by Framework

Browse Popular Code Answers by Language