diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index f218408..6fa74f2 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@pushrocks/smartrequest', - version: '2.0.5', + version: '2.0.6', description: 'dropin replacement for request' } diff --git a/ts/smartrequest.request.ts b/ts/smartrequest.request.ts index 5654eb1..9e0d473 100644 --- a/ts/smartrequest.request.ts +++ b/ts/smartrequest.request.ts @@ -60,13 +60,17 @@ const parseSocketPathAndRoute = (stringToParseArg: string) => { const httpAgent = new plugins.agentkeepalive({ keepAlive: true, maxFreeSockets: 10, + maxSockets: 100, + maxTotalSockets: 1000, + timeout: 60000, }); /** * a custom http agent to make sure we can set custom keepAlive options for speedy subsequent calls */ -const httpAgentKeepAliveFalse = new plugins.https.Agent({ - keepAlive: false +const httpAgentKeepAliveFalse = new plugins.agentkeepalive({ + keepAlive: false, + timeout: 60000 }); /** @@ -75,14 +79,17 @@ const httpAgentKeepAliveFalse = new plugins.https.Agent({ const httpsAgent = new plugins.agentkeepalive.HttpsAgent({ keepAlive: true, maxFreeSockets: 10, + maxSockets: 100, + maxTotalSockets: 1000, + timeout: 60000 }); /** * a custom https agent to make sure we can set custom keepAlive options for speedy subsequent calls */ const httpsAgentKeepAliveFalse = new plugins.agentkeepalive.HttpsAgent({ - maxFreeSockets: 0, - keepAlive: false + keepAlive: false, + timeout: 60000 }); export let request = async (