gpt4 book ai didi

javascript - node.js 中长进程的最大执行时间

转载 作者:搜寻专家 更新时间:2023-11-01 00:15:01 25 4
gpt4 key购买 nike

Node.js 中的最长 HTTP 请求执行时间为 120 秒,如何增加 http get/post 请求的最长执行时间?

注意:我使用的是 expressjs 框架

最佳答案

http://nodejs.org/api/http.html#http_server_timeout

server.timeout

Number Default = 120000 (2 minutes) The number of milliseconds of inactivity before a socket is presumed to have timed out.

Note that the socket timeout logic is set up on connection, so changing this value only affects new connections to the server, not any existing connections.

Set to 0 to disable any kind of automatic timeout behavior on incoming connections.

关于javascript - node.js 中长进程的最大执行时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27004316/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com