Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

max_time only applies _after_ first retry? #186

Open
fiendish opened this issue Dec 21, 2022 · 0 comments
Open

max_time only applies _after_ first retry? #186

fiendish opened this issue Dec 21, 2022 · 0 comments

Comments

@fiendish
Copy link

fiendish commented Dec 21, 2022

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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant