Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
c6fa540543 | |||
1891b54389 | |||
fee8443af1 | |||
c48f956ae3 |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@pushrocks/smartrequest",
|
||||
"version": "2.0.5",
|
||||
"version": "2.0.7",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@pushrocks/smartrequest",
|
||||
"version": "2.0.5",
|
||||
"version": "2.0.7",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pushrocks/smartpromise": "^3.1.7",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartrequest",
|
||||
"version": "2.0.5",
|
||||
"version": "2.0.7",
|
||||
"private": false,
|
||||
"description": "dropin replacement for request",
|
||||
"main": "dist_ts/index.js",
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/smartrequest',
|
||||
version: '2.0.5',
|
||||
version: '2.0.7',
|
||||
description: 'dropin replacement for request'
|
||||
}
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user