-
Notifications
You must be signed in to change notification settings - Fork 149
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
backoff.expo base #42
Comments
Sorry for the slow response - I was away last week. You may be right that it should be
but I need to refresh my thinking about I will get back to you when I have a few minutes to investigate. |
Happy to submit a ludicrously small PR if you like ; ) |
I think the equation itself makes sense as it is. In
If I'm not mistaken, it looks like the only change required here is to set |
I prefer this approach. |
First off, crackin' little library. Really like the api.
However, in backoff.expo:
https://github.com/litl/backoff/blob/master/backoff/_wait_gen.py#L14
Having n=0 means the second attempt will always happen only 1 second after the first attempt, regardles of base, factor.
My assumption was that base would set the minimum backoff time.
Is this intended behaviour? To me it seems counter-intuitive to the meaning of the 'base' parameter!
This could be addressed in one of two simple ways.
Change
https://github.com/litl/backoff/blob/master/backoff/_wait_gen.py#L14
to
OR
change
https://github.com/litl/backoff/blob/master/backoff/_wait_gen.py#L16
to
Either of these changes would mean the minimum retry interval was equal to base, and not 1.
The text was updated successfully, but these errors were encountered: