-
Notifications
You must be signed in to change notification settings - Fork 167
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
Exponential backoff? #3
Comments
We wrote this plugin just to retry network errors and we didn't expect to retry too many times, but that's a feature that could be added (together with #2). Perhaps a |
Unfortunately, I realized a bit later that the environment that I am running my code in does not support JS promises (old version of SeaMonkey), sorry. This means no more axios for us. Once I fix this, sure, but right now upgrading things is a "nice to have" for us. |
I'm also looking for exponential backoff, but even a simple way to control the retry timeout would be useful. My suggestion is to have two configuration methods: Simple config retry: {
attempts: 5,
delay: 1000
} or a function, to allow exponential backoff. returning retry: (attempt) => {
if (attempt > 5) { return -1 }
return 1000 * attempt
} |
I'm back, working on this. |
Well, I've basically just implemented this in my fork: https://github.com/s3rious/axios-retry/blob/master/es/index.js#L116 Config now receives 3 arguments, I've added If someone can help with tests and |
@s3rious Just replaced the |
interested in exponential delay as well |
[edit] Incorrect statement. @s3rious Why don't you create a PR? |
Is there any progress on that? |
Sorry I must have missed that there is a PR open... Thanks! |
This is great. |
Change eslint config to eslint-config-vtex
It's "good practices" to have exponential backoff for successive retries. Any plans to implement this?
The text was updated successfully, but these errors were encountered: