File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ const http = require('http')
20
20
const https = require ( 'https' )
21
21
const pkg = require ( '../package.json' )
22
22
const AGENT_DEFAULTS = { keepAlive : true , maxSockets : 50 , keepAliveMsecs : 30000 }
23
+ const defaultHttpAgent = new http . Agent ( AGENT_DEFAULTS )
24
+ const defaultHttpsAgent = new https . Agent ( AGENT_DEFAULTS )
23
25
const ChangesReader = require ( './changesreader.js' )
24
26
25
27
function isEmpty ( val ) {
@@ -331,8 +333,8 @@ module.exports = exports = function dbScope (cfg) {
331
333
} else if ( opts . dontParse ) {
332
334
req . responseType = 'arraybuffer'
333
335
}
334
- req . httpAgent = cfg . requestDefaults . agent || new http . Agent ( AGENT_DEFAULTS )
335
- req . httpsAgent = cfg . requestDefaults . agent || new https . Agent ( AGENT_DEFAULTS )
336
+ req . httpAgent = cfg . requestDefaults . agent || defaultHttpAgent
337
+ req . httpsAgent = cfg . requestDefaults . agent || defaultHttpsAgent
336
338
337
339
// actually do the HTTP request
338
340
if ( opts . stream ) {
You can’t perform that action at this time.
0 commit comments