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

Multiple request retry #145

Open
qqfei1858 opened this issue Apr 6, 2021 · 2 comments
Open

Multiple request retry #145

qqfei1858 opened this issue Apr 6, 2021 · 2 comments

Comments

@qqfei1858
Copy link

My English is not good, sorry, please be patient and finish reading! It seems that retry-axios can only retry one request, but there are multiple real-time requests on the webpage, which cannot meet the needs of the project! Is there a setting or other scheme that can handle multiple requests and retry?

@JustinBeckwith
Copy link
Owner

Greetings! It should be able to handle multiple retries, and retries across requests. Can you share what you've tried? Maybe share your code, and what you're seeing?

@qqfei1858
Copy link
Author

qqfei1858 commented Apr 6, 2021

@JustinBeckwith Hello,below is the code snippet, the test really only has one request to trigger a retry!
axios version: 0.21.0
chrome version: 89

const instance= axios.create({
    baseURL:  xxx,
    timeout:  2 * 60
});

instance.defaults.raxConfig = {
    retry: 99,
    noResponseRetries: 99,
    retryDelay: 3 * 1000,
    instance: instance
};

rax.attach(instance);

instance.interceptors.request.use(config => {...},err=>{...});
instance.interceptors.response.use(response => {...},err=>{...});

export default instance;

the axios request is encapsulated, and the exported instance is used externally to request

await instance({
    url: xxx,
    method: 'get',
    params:xxx
});

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

2 participants