elasticio-sailor-nodejs 2.6.28-dev2 → 2.6.29-dev1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.nsprc CHANGED
@@ -0,0 +1,6 @@
1
+ {
2
+ "GHSA-wc69-rhjr-hc9g": {
3
+ "active": true,
4
+ "notes": "Bunyan library set only new Date to momentjs as parameter"
5
+ }
6
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "editor.rulers": [
3
+ {
4
+ "column": 120
5
+ }
6
+ ]
7
+ }
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 2.6.29 (July 14, 2022)
2
+
3
+ * Enabled keep-alive for global HTTPS agent ([#6359](https://github.com/elasticio/elasticio/issues/6359))
4
+
5
+ ## 2.6.28 (June 21, 2022)
6
+
7
+ * Fix: "sailor-nodejs ignores errors from maester during lightweight message upload" [#6233](https://github.com/elasticio/elasticio/issues/6233))
8
+
1
9
  ## 2.6.27 (March 10, 2022)
2
10
 
3
11
  * Added npm audit to CI and fixed all dependencies
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "elasticio-sailor-nodejs",
3
3
  "description": "The official elastic.io library for bootstrapping and executing for Node.js connectors",
4
- "version": "2.6.28-dev2",
4
+ "version": "2.6.29-dev1",
5
5
  "main": "run.js",
6
6
  "scripts": {
7
7
  "audit": "better-npm-audit audit --level high --production",
@@ -9,8 +9,7 @@
9
9
  "pretest": "npm run lint",
10
10
  "test": "npm run test:jasmine && npm run test:mocha",
11
11
  "test:jasmine": "NODE_ENV=test jasmine-node spec",
12
- "test:mocha": "NODE_ENV=test node_modules/.bin/mocha --recursive mocha_spec",
13
- "postpublish": "./postpublish.js"
12
+ "test:mocha": "NODE_ENV=test node_modules/.bin/mocha --recursive mocha_spec"
14
13
  },
15
14
  "engines": {
16
15
  "node": ">=12.13.0"
package/run.js CHANGED
@@ -7,16 +7,21 @@ const settings = require('./lib/settings.js');
7
7
  const { IPC } = require('./lib/ipc.js');
8
8
  const Q = require('q');
9
9
  const http = require('http');
10
+ const https = require('https');
10
11
 
11
12
  let sailor;
12
13
  let sailorInit;
13
14
  let disconnectRequired;
14
15
 
15
- // miserable try to workaround issue described in https://github.com/elasticio/elasticio/issues/4874
16
- const { Agent } = http;
17
- http.globalAgent = new Agent({
18
- keepAlive: true
19
- });
16
+ function prepareSandbox() {
17
+ // enable keep alive by default to handle issues like https://github.com/elasticio/elasticio/issues/4874
18
+ http.globalAgent = new http.Agent({
19
+ keepAlive: true
20
+ });
21
+ https.globalAgent = new https.Agent({
22
+ keepAlive: true
23
+ });
24
+ }
20
25
 
21
26
  async function putOutToSea(settings, ipc) {
22
27
  ipc.send('init:started');
@@ -88,6 +93,7 @@ async function gracefulShutdown() {
88
93
  }
89
94
 
90
95
  async function run(settings, ipc) {
96
+ prepareSandbox();
91
97
  try {
92
98
  await putOutToSea(settings, ipc);
93
99
  logger.info('Fully initialized and waiting for messages');