Skip to content

Commit

Permalink
update agentkeepalive and tune its parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
denis committed Dec 17, 2022
1 parent d4fd0ef commit 2218e77
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 12 deletions.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
38 changes: 30 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "calibr <[email protected]>",
"license": "ISC",
"dependencies": {
"agentkeepalive": "^3.3.0",
"agentkeepalive": "^4.2.1",
"lodash": "^3.9.3",
"nodeify": "^1.0.1",
"request": "^2.73.0"
Expand Down
3 changes: 1 addition & 2 deletions test/modify_req.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2218e77

Please sign in to comment.