From ed2d51a23524b0fb29a880ec512ad4d0b4b77ba7 Mon Sep 17 00:00:00 2001 From: Navrotskyj Date: Wed, 21 Sep 2016 14:59:22 +0300 Subject: [PATCH] add httpRequest timeout --- src/middleware/httpRequest.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/middleware/httpRequest.js b/src/middleware/httpRequest.js index a5c1d1c..fc4e0ea 100644 --- a/src/middleware/httpRequest.js +++ b/src/middleware/httpRequest.js @@ -95,18 +95,19 @@ module.exports = function (parameters, router, cb) { let method = parameters['method'] || 'post', exportVariables = parameters['exportVariables'] || DEF_EXPORT_VAR(), - headers = parameters['headers'] || DEF_HEADERS(); + headers = parameters['headers'] || DEF_HEADERS(), + timeout = parameters.timeout || 1000; let webArgs = { data: parameters['data'] || DEF_DATA(), headers: parseObject(headers), requestConfig: { - timeout: 1000, //request timeout in milliseconds + timeout: timeout, //request timeout in milliseconds keepAlive: false //Enable/disable keep-alive functionalityidle socket. }, responseConfig: { - timeout: 1000 //response timeout + timeout: timeout //response timeout } }; method = method.toLowerCase();