-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Axios not respecting the value I set for "timeout" #1503
Comments
timeout depends on both client side and server side, do you want to check your server side config first? e.g., tomcat timeout configs? or sth like that? in short, while client is still waiting, the server shouldn't close that connection. you could verify this by running a dummy nodejs server which wait, the timeout actually works:
client.js
|
Hi @coolgod , You were right, the problem was in the server. I didn't consider that possibility before because even when the connection was closed the application kept processing the data. Here is what I did to solve the issue: There is one more thing, I don't know why, but I was only able to test it after publishing the application to IIS. The test does not work when debbuging the application. Again, |
You should mark this issue as resolved, shouldn't you ? |
Adding timeout in the config won't work. |
@ziszo this works in general or I have to use it with every single request? |
You have to set it for every instance of axios.In the case below, buildAxios() is called for each request.
P.S. Above code is typescript. Don't confuse with your code. |
So is this resolved now? |
@Marcholio yes, use |
I have used axios.defaults.timeout = 5000 in React Native project. And it is worked. |
`
} |
* Revert PR https://github.com/stellar/js-stellar-sdk/pull/465/files * Use axios CancelToken to ensure timeout Axios timeout doesn't catch missing urls, e.g. those with no response so we use the axios cancel token to ensure the timeout. axios/axios#647 axios/axios#1503 * adjustments to get tests to pass
Summary
Hi there,
I've been using axios a lot in my web application. Everything has been working just fine in most cases.
Today, I've got a new demand in my application using axios, but I can't get it working.
I am creating the possibility to import data to my application. The user uploads a .csv file to my server, and with axios I am calling a method in my controller to process data.
The issue I am facing is related to the timeout parameter set when using axios.
I have a large amount of data to import, so it will take more than 2 minutes to process all the data.
Whatever value bigger than 2 minutes won't be considered by axios. It only waits for 2 minutes, and them returns an error.
Am I missing something here? I checked the documentation and made sure I was using what is recommended in "Config order of precedence", but I still can't make it work.
Would someone help me out?
Context
My implementation
The text was updated successfully, but these errors were encountered: