Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
c9c8a1234c | |||
dffabd905f | |||
36f2707141 | |||
b00d674b6f |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartrequest",
|
"name": "@pushrocks/smartrequest",
|
||||||
"version": "1.1.25",
|
"version": "1.1.27",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartrequest",
|
"name": "@pushrocks/smartrequest",
|
||||||
"version": "1.1.25",
|
"version": "1.1.27",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "dropin replacement for request",
|
"description": "dropin replacement for request",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@ -66,8 +66,9 @@ const httpAgent = new plugins.http.Agent({
|
|||||||
* a custom http agent to make sure we can set custom keepAlive options for speedy subsequent calls
|
* a custom http agent to make sure we can set custom keepAlive options for speedy subsequent calls
|
||||||
*/
|
*/
|
||||||
const httpAgentKeepAliveFalse = new plugins.http.Agent({
|
const httpAgentKeepAliveFalse = new plugins.http.Agent({
|
||||||
|
maxFreeSockets: 0,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
keepAliveMsecs: 600000
|
keepAliveMsecs: 0
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -82,8 +83,9 @@ const httpsAgent = new plugins.https.Agent({
|
|||||||
* a custom https agent to make sure we can set custom keepAlive options for speedy subsequent calls
|
* a custom https agent to make sure we can set custom keepAlive options for speedy subsequent calls
|
||||||
*/
|
*/
|
||||||
const httpsAgentKeepAliveFalse = new plugins.https.Agent({
|
const httpsAgentKeepAliveFalse = new plugins.https.Agent({
|
||||||
|
maxFreeSockets: 0,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
keepAliveMsecs: 600000
|
keepAliveMsecs: 0
|
||||||
});
|
});
|
||||||
|
|
||||||
export let request = async (
|
export let request = async (
|
||||||
@ -128,13 +130,13 @@ export let request = async (
|
|||||||
case parsedUrl.protocol === 'https:' && optionsArg.keepAlive:
|
case parsedUrl.protocol === 'https:' && optionsArg.keepAlive:
|
||||||
optionsArg.agent = httpsAgent;
|
optionsArg.agent = httpsAgent;
|
||||||
return plugins.https;
|
return plugins.https;
|
||||||
case parsedUrl.protocol === 'https:' && !optionsArg.keepAlive:
|
case parsedUrl.protocol === 'https:' && (!optionsArg.keepAlive):
|
||||||
optionsArg.agent = httpsAgentKeepAliveFalse;
|
optionsArg.agent = httpsAgentKeepAliveFalse;
|
||||||
return plugins.https;
|
return plugins.https;
|
||||||
case parsedUrl.protocol === 'http:' && optionsArg.keepAlive:
|
case parsedUrl.protocol === 'http:' && optionsArg.keepAlive:
|
||||||
optionsArg.agent = httpAgent;
|
optionsArg.agent = httpAgent;
|
||||||
return plugins.http;
|
return plugins.http;
|
||||||
case parsedUrl.protocol === 'http:' && !optionsArg.keepAlive:
|
case parsedUrl.protocol === 'http:' && (!optionsArg.keepAlive):
|
||||||
optionsArg.agent = httpAgentKeepAliveFalse;
|
optionsArg.agent = httpAgentKeepAliveFalse;
|
||||||
return plugins.http;
|
return plugins.http;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user