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

Retries made if no error happened, when set_active is set to False #53

Closed
toichiserada opened this issue Jan 3, 2024 · 2 comments · Fixed by #54
Closed

Retries made if no error happened, when set_active is set to False #53

toichiserada opened this issue Jan 3, 2024 · 2 comments · Fixed by #54
Labels
bug Something isn't working

Comments

@toichiserada
Copy link

In [11]: stamina.set_active(False)
    ...: for attempt in stamina.retry_context(on=ValueError, wait_initial=1, wait_max=2, timeout=40, wait_jitter=0, wait_exp_base=2, attempts=0):
    ...:     with attempt:
    ...:         print(attempt)
    ...:         time.sleep(1)
    ...:         print("test")
<Attempt num=1>
test
<Attempt num=1>
test

When set active is set to True it behaves like it should.

In [11]: stamina.set_active(True)
    ...: for attempt in stamina.retry_context(on=ValueError, wait_initial=1, wait_max=2, timeout=40, wait_jitter=0, wait_exp_base=2, attempts=0):
    ...:     with attempt:
    ...:         print(attempt)
    ...:         time.sleep(1)
    ...:         print("test")
<Attempt num=1>
test
@toichiserada toichiserada added the bug Something isn't working label Jan 3, 2024
hynek added a commit that referenced this issue Jan 3, 2024
hynek added a commit that referenced this issue Jan 3, 2024
@hynek
Copy link
Owner

hynek commented Jan 3, 2024

Oof, that bug is just as stupid as one would expect! I'll push a release soon-ish after #54 is merged.

hynek added a commit that referenced this issue Jan 3, 2024
@hynek hynek closed this as completed in #54 Jan 3, 2024
hynek added a commit that referenced this issue Jan 3, 2024
@hynek
Copy link
Owner

hynek commented Jan 3, 2024

fix is on PyPI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants