-
Notifications
You must be signed in to change notification settings - Fork 60
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
Retries issues #104
Comments
I spent some time diving into the problem (as I saw the same happening in one of my projects) and figured out that response interceptor installed by
Downgrading |
downgrading worked for me. thanks @khitrenovich ! but the retries count here stays at 1 regardless of how many retries I gave it |
Seeing this too. The setting has no effect and only 2 attempts are tried. Edit: I tried all versions, including the 0.20 beta, and 0.18 downgrade |
I was having a similar problem using the following setup:
Changing the values in raxConfig above was having no effect. When I saw this ticket, I noticed I was using axios 0.19 and updated it to axios 0.21, which solved the problem for me |
So this is a little confusing :) One thing to look out for here, are that there are separate settings for To get it to use 3 retries every time (regardless of the reason it fails), this ought to work: const rax = require('retry-axios');
const axios = require('axios');
rax.attach();
async function main() {
try {
await axios({
url: 'https://test.local',
raxConfig: {
retry: 3,
noResponseRetries: 3,
onRetryAttempt: err => {
const cfg = rax.getConfig(err);
console.log(`Retry attempt #${cfg.currentRetryAttempt}`);
}
},
});
} catch (err) {
console.error(err);
}
}
main(); Note, this is using:
For anyone else that comes here - please make sure to post the exact code you're using :) Also, it would be helpful to include the versions of axios and retry-axios, as well as the error you're getting when the request fails. |
It works with the default axios, but doesn't work with axios instance ( |
By default , retry count is set to 3. But It's only trying two times. Doesn't have any effect if I define it to be 3, 4 or 5. It only tries 2 times. Please fix this issue. Thanks
The text was updated successfully, but these errors were encountered: