from yet_another_retry import retry, RetryConfig
from yet_another_retry.retry_handlers import exponential_backoff


@retry(
    retry_handler=exponential_backoff,
    tries=5,
    retry_delay=1,
    exponential_factor=2,
    max_delay_seconds=60,
    jitter_range=10,
)
def my_function(retry_config: RetryConfig):
    print(f"This is attempt number: {retry_config.attempt}")
    print(f"Last sleep was {retry_config.previous_delay}")
    raise Exception("This is an exception")


my_function()
