on-internet
← Community

Python Exponential BackOff

Stack Overflow ·

I tried to implement the exponential backoff for my function using the reference code in Implementing a retry routine However in my case I do not want my function to fail or throw an error after the set number of retries. I would want to catch the error and log it and continue with the rest of the code. Tried multiple things but did not work for me. If someone could assist that would be great. Below is the the sample code. Also please make comments if I'm not handling the other custom exception correctly. import random, time from functools import wraps class ThrottledException(Exception): pass

Comments

Sign in or sign up to comment and upvote.

No comments yet.