litl / backoff

Python library providing function decorators for configurable backoff and retry
MIT License
2.61k stars 148 forks source link

Customize backoff.expo #169

Closed StefanSchuhart closed 2 years ago

StefanSchuhart commented 2 years ago

How can one customize backoff.expo, e.g. max_value?

r3g3 commented 2 years ago

Please read the README. It's the best documentation for now. Short answer is the keyword args of the wait generators (backoff.expo, backoff.expo, etc. can be specified as arguments to the decorator itself.

@backoff.on_exception(backoff.expo, ValueError, max_value=10)
def do_something():
    # ...