0

I currently have a request which is made from an angular 4 app(which uses electron[which uses chromium]) to a bottleneck(nodejs/express) server. The server takes about 10 minutes to process the request. The default timeout which I'm getting is 120 seconds. I tried to use setting the timeout on the server using

App.use(timeout("1000s")

In the client side I have used

options = {
url,
method: GET
timeout : 600 * 1000} 
let req = http.request(options, () => {})
req.end()

I have also tried to give the specific route timeout. Each time the request hits 120 seconds the socket dies and I get a "socket timeout"

I have read many posts with the same questions but I didn't get any concrete answers. Is it possible to do a request with a long/no timeout using the tools above? Do I need to download a new library which handles long timeouts?

Any help would be greatly appriciated.

2
  • 2
    if response takes a long time ~10mins, i would suggest to send request and get an id to later on check its status, or wait for server to send back response using websocket etc. Commented Jan 28, 2019 at 15:06
  • That is a good temporary solution, but due to a few problems that the app has(some code debt from years past) this looks like it will open a host of new stuff that will be needed to track. Commented Jan 28, 2019 at 15:29

1 Answer 1

1

So after browsing through the internet I have discovered that there is no possible way to increase Chrome's timeout time. My solution to this problem was to open the request and return a default answer(something like "started") then pinging the server to find out it's status.

There is another possible solution which will be to put a route in the client(I'm using electron and node modules in the client side so it is possible) and then let the server ping back to the client with the status of the query. Writing this down so other people will have some possible patches. Will update if I'll find anything better.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.