-
Notifications
You must be signed in to change notification settings - Fork 203
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
Add retry to axios when the api did not respond (ENOTFOUND, ETIMEDOUT, etc) to prevent network glitches #651
Comments
leopucci
changed the title
add retry to axios when the api did not respond
Add retry to axios when the api did not respond
Aug 31, 2021
leopucci
changed the title
Add retry to axios when the api did not respond
Add retry to axios when the api did not respond (ENOTFOUND, ETIMEDOUT, etc)
Aug 31, 2021
leopucci
changed the title
Add retry to axios when the api did not respond (ENOTFOUND, ETIMEDOUT, etc)
Add retry to axios when the api did not respond (ENOTFOUND, ETIMEDOUT, etc) to prevent network glitches
Aug 31, 2021
Feel free to add your interceptors to the underlying axios instance: For example: const client = new MessengerClient({
accessToken: ACCESS_TOKEN,
appId: APP_ID,
appSecret: APP_SECRET,
version: '6.0',
});
client.axios.defaults.raxConfig = {
instance: client.axios
};
const interceptorId = rax.attach(client.axios); |
Nice! I din´t get it how could I attach it. I just did it. 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. Thanks for this module. It help´s me a lot!
Sometimes api´s freezes for one second or so. Or a minor network problem.
Why not retry on no response errors?
There is a package for axios. https://www.npmjs.com/package/retry-axios
There is a way to pin point the exact codes to retry,
you can retry only on no response,
or you can retry on specific http response codes.
i don´t know the proper response codes from the api that this could be useful
But I do think that 2 retries if the api does not respond is a good thing that can prevent minor network problems and guarantee more sucess on the delivering.
The text was updated successfully, but these errors were encountered: