backoff icon indicating copy to clipboard operation
backoff copied to clipboard

max_time only applies _after_ first retry?

Open fiendish opened this issue 1 year ago • 0 comments

Why does this still retry when the decorated function takes longer than max_time?

import backoff
import time

@backoff.on_exception(
    backoff.expo,
    (
        Exception,
    ),
    max_time=2,
    jitter=None
)
def do_thing():
    print(f"doing thing")
    time.sleep(5)
    print(f"end thing")
    raise Exception("I failed")

do_thing()

fiendish avatar Dec 21 '22 21:12 fiendish