You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
// Retry 3 times on requests that return a response (500, etc) before giving up. Defaults to 3.
retry: 3,
// Retry twice on errors that don't return a response (ENOTFOUND, ETIMEDOUT, etc).
noResponseRetries: 2,
// Milliseconds to delay at first. Defaults to 100. Only considered when backoffType is 'static'
retryDelay: 100,
// HTTP methods to automatically retry. Defaults to:
// ['GET', 'HEAD', 'OPTIONS', 'DELETE', 'PUT']
httpMethodsToRetry: ['GET', 'HEAD', 'OPTIONS', 'DELETE', 'PUT'],
// The response status codes to retry. Supports a double
// array with a list of ranges. Defaults to:
// [[100, 199], [429, 429], [500, 599]]
statusCodesToRetry: [[100, 199], [429, 429], [500, 599]],
The text was updated successfully, but these errors were encountered:
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
Nice! I din´t get it how could I attach it. I just did it. 👍
Thanks @chentsulin 🥇
I will let the issue open to you guys discuss if this is a good fit to add globally to the code or just to let user attach by himself.
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: