Skip to content

Commit

Permalink
#5012 added http global agent with keep alive (#167)
Browse files Browse the repository at this point in the history
* #5012 added http global agent with keep alive

* #5012 updated changelog
  • Loading branch information
zuker committed Dec 23, 2020
1 parent 9253773 commit 9e6b79a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.6.22 (December 23, 2020)

* Enabled keep-alive for global HTTP agent ([#5012](#https://github.com/elasticio/elasticio/issues/5012))

## 2.6.21 (December 3, 2020)

* Fixed rebound message expiry time ([#4950](https://github.com/elasticio/elasticio/issues/4950))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "elasticio-sailor-nodejs",
"description": "The official elastic.io library for bootstrapping and executing for Node.js connectors",
"version": "2.6.21",
"version": "2.6.22",
"main": "run.js",
"scripts": {
"lint": "./node_modules/.bin/eslint lib spec mocha_spec lib run.js runService.js",
Expand Down
7 changes: 7 additions & 0 deletions run.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@ const logger = require('./lib/logging.js');
const Sailor = require('./lib/sailor.js').Sailor;
const settings = require('./lib/settings.js');
const co = require('co');
const http = require('http');

let sailor;
let disconnectRequired;

// miserable try to workaround issue described in https://github.com/elasticio/elasticio/issues/4874
const { Agent } = http;
http.globalAgent = new Agent({
keepAlive: true
});

async function putOutToSea(settings) {
sailor = new Sailor(settings);

Expand Down

0 comments on commit 9e6b79a

Please sign in to comment.