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

标签 javascript node.js

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/

相关文章:

javascript - 为什么 Javascript 语法使用多个括号?

javascript - 如何在查找字符串中的所有 url 时停止显示 mailto

javascript - 有没有办法只在需要的时候加载 JS 和 CSS?

javascript - 使用 gl-react-image 旋转图像

javascript - 如何在grafana datasource-plugin中使用外部库

node.js - Bower 安装后缺少 bower_components 文件夹

javascript - 从父窗口到 2 层嵌套 iframe 的事件监听器可能吗?

javascript - 什么更快 : `find().limit(1)` or `findOne()` in MongoDB/Mongoose?

node.js - 跨容器传递容器IP以获取配置文件

node.js - Sequelize : setting separate flag causes Unknown column error