obelisk.strategies.retry.ExponentialBackoffStrategy¶
- class obelisk.strategies.retry.ExponentialBackoffStrategy(max_retries: int = 5, backoff: timedelta = datetime.timedelta(seconds=2), max_backoff: timedelta = datetime.timedelta(days=1))[source]¶
Bases:
RetryStrategy
Retry strategy implementing the exponential backoff algorithm. Every failure up to max_retries will result in a sleep of t ** n seconds, with t being the backoff and n amount of failures.
Note that backoff values less than one second will count as zero.
Methods
make
()Create an instance of a RetryEvaluator.
- __init__(max_retries: int = 5, backoff: timedelta = datetime.timedelta(seconds=2), max_backoff: timedelta = datetime.timedelta(days=1)) None [source]¶
Methods
__init__
([max_retries, backoff, max_backoff])make
()Create an instance of a RetryEvaluator.
Attributes
max_retries
backoff
max_backoff
- make() RetryEvaluator [source]¶
Create an instance of a RetryEvaluator. Custom strategies should also subclass RetryEvaluator