Compare commits

...

6 Commits

Author SHA1 Message Date
d3d0649b73 2.0.8 2022-08-01 17:10:22 +02:00
fba43df3c4 fix(core): update 2022-08-01 17:10:22 +02:00
c6fa540543 2.0.7 2022-08-01 17:10:11 +02:00
1891b54389 fix(core): update 2022-08-01 17:10:11 +02:00
fee8443af1 2.0.6 2022-07-30 18:43:11 +02:00
c48f956ae3 fix(core): update 2022-07-30 18:43:10 +02:00
4 changed files with 16 additions and 8 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@pushrocks/smartrequest",
"version": "2.0.5",
"version": "2.0.8",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@pushrocks/smartrequest",
"version": "2.0.5",
"version": "2.0.8",
"license": "MIT",
"dependencies": {
"@pushrocks/smartpromise": "^3.1.7",

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartrequest",
"version": "2.0.5",
"version": "2.0.8",
"private": false,
"description": "dropin replacement for request",
"main": "dist_ts/index.js",

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smartrequest',
version: '2.0.5',
version: '2.0.8',
description: 'dropin replacement for request'
}

View File

@ -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 (
@ -180,6 +187,7 @@ export let request = async (
// lets handle an error
requestToFire.on('error', (e) => {
console.error(e);
requestToFire.destroy();
});
const result = await done.promise;