From 2218e77aa4906ddc9b98723db7c2fc85f6110ced Mon Sep 17 00:00:00 2001 From: denis Date: Sat, 17 Dec 2022 12:17:12 +0200 Subject: [PATCH] update agentkeepalive and tune its parameters --- index.js | 5 ++++- package-lock.json | 38 ++++++++++++++++++++++++++++++-------- package.json | 2 +- test/modify_req.js | 3 +-- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/index.js b/index.js index 63f810b..2c476d4 100644 --- a/index.js +++ b/index.js @@ -10,7 +10,10 @@ var var defaultAgentOptions = { keepAlive: true, // because node http server default timeout is 120 seconds, close socket before its timeout - freeSocketKeepAliveTimeout: 110000 + freeSocketKeepAliveTimeout: 110000, + freeSocketTimeout: 110000, + // timeout of a request 5 minutes + timeout: 300e3 }; var Factory = function(apiURL) { diff --git a/package-lock.json b/package-lock.json index 66054ac..498d91f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,32 @@ { "name": "eh-api-client", - "version": "0.46.3", + "version": "0.47.6", "lockfileVersion": 1, "requires": true, "dependencies": { "agentkeepalive": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.3.0.tgz", - "integrity": "sha512-9yhcpXti2ZQE7bxuCsjjWNIZoQOd9sZ1ZBovHG0YeCRohFv73SLvcm73PC9T3olM4GyozaQb+4MGdQpcD8m7NQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz", + "integrity": "sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==", "requires": { + "debug": "^4.1.0", + "depd": "^1.1.2", "humanize-ms": "^1.2.1" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } } }, "ajv": { @@ -140,6 +157,11 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==" + }, "diff": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/diff/-/diff-1.4.0.tgz", @@ -281,15 +303,15 @@ "humanize-ms": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", "requires": { "ms": "^2.0.0" }, "dependencies": { "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" } } }, diff --git a/package.json b/package.json index 5261a5c..6c38421 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "author": "calibr ", "license": "ISC", "dependencies": { - "agentkeepalive": "^3.3.0", + "agentkeepalive": "^4.2.1", "lodash": "^3.9.3", "nodeify": "^1.0.1", "request": "^2.73.0" diff --git a/test/modify_req.js b/test/modify_req.js index 16ab3fa..0adb088 100644 --- a/test/modify_req.js +++ b/test/modify_req.js @@ -4,8 +4,7 @@ var sinon = require("sinon"), http = require("http"), async = require("async"), - URL = require("url"), - Promise = require("bluebird"); + URL = require("url") var SERVER_PORT = 8591; var SERVER_TIMEOUT = 1000;