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

attempt_number should be set to 0 #459

Open
Rohiniab84 opened this issue May 7, 2024 · 1 comment
Open

attempt_number should be set to 0 #459

Rohiniab84 opened this issue May 7, 2024 · 1 comment

Comments

@Rohiniab84
Copy link

self.attempt_number: int = 1

attempt_number should be set to 1
the stop_after_attempt is checking current_attempt >= max_attempt
As aresult we are retrying 1 less time than max_attempt

In case max_attempt = 1, there are no retries.
The condition for stop after retry should be ">" and not ">=" OR attempt_number should be set to 0

@tuukkamustonen
Copy link

I believe the "max attempt" is not for retries, but for all attempts.

Ie. stop_after_attempt(1) means no retries, because it gives up after the first attempt.

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

2 participants