Express app.post getting called multiple times

两盒软妹~` 提交于 2019-12-01 06:40:19

So after just getting down to a very basic post route and logging out some text but not returning a response, I came to the conclusion the issue resides with node. I decided to record the length of time between the console.log statements which turned out to be every 2 minutes. With this I was able to find out that node has a default timeout of 2 minutes if a response is not sent back to the client.

I was able to set the response to never timeout with the following code:

res.connection.setTimeout(0);

I hope this helps anyone else that needs to hold connections for large periods of times for file conversions/transfers etc...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!