Sobes.tech
Junior — Senior

Decorator for automatic retry of API requests

livecode

Task condition

Create a decorator that, when exceptions occur, will retry the wrapped function. The delay between attempts should increase exponentially (according to the formula 2^n seconds). The decorator must log each failed attempt and stop trying after five unsuccessful runs or upon successful completion of the function.