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

Backoff constant should be configurable #14

Open
dalemyers opened this issue Aug 7, 2023 · 0 comments
Open

Backoff constant should be configurable #14

dalemyers opened this issue Aug 7, 2023 · 0 comments

Comments

@dalemyers
Copy link

dalemyers commented Aug 7, 2023

Currently, if you use @delay_retry then the exponent is the constant 10. This means 5 repeats go from 0.05 -> 0.5 -> 5 -> 50 -> 500.

If for example, you have an API quota which has 60 second windows, you can't repeat 4 times as you would only cover 55.55 seconds. Instead, you need to go to the next one, which is over 8 minutes long. Being able to set a much smaller exponent would make this infinitely more useful. e.g. if 2 is used:

0.05 -> 0.1 -> 0.2 -> 0.4 -> 0.8 -> 1.6 -> 3.2 -> 6.4 -> 12.8 -> 25.6 -> 51.2

This way we only "waste" 42 seconds. Of course, every API and everyone's usage is different, so there many be many even better reasons to make this configurable.

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