From 7389fcebb75b93b7a940826903a67f36d6f3815b Mon Sep 17 00:00:00 2001 From: Dawid Rusnak Date: Fri, 19 May 2017 12:05:43 +0200 Subject: [PATCH] Add keep alive param --- connector-es6.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/connector-es6.js b/connector-es6.js index b517aa8..d3c38b6 100644 --- a/connector-es6.js +++ b/connector-es6.js @@ -49,6 +49,7 @@ class HttpAmazonESConnector extends HttpConnector { var headers = {}; var log = this.log; var response; + var keepAlive = params.keepAlive === undefined ? true : !!params.keepAlive; var reqParams = this.makeReqParams(params); // general clean-up procedure to run after the request @@ -111,7 +112,7 @@ class HttpAmazonESConnector extends HttpConnector { req.on('error', cleanUp); req.setNoDelay(true); - req.setSocketKeepAlive(true); + req.setSocketKeepAlive(keepAlive); return function () { req.abort();