@nginstack/engine-node 59.0.1 → 60.0.4
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/README.md +1 -1
- package/lib/Engine.js +4 -10
- package/package.json +2 -2
package/README.md
CHANGED
package/lib/Engine.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const child_process = require('child_process');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
const fs = require('fs');
|
|
4
|
-
const url = require('url');
|
|
5
4
|
const del = require('del');
|
|
6
5
|
const request = require('request');
|
|
7
6
|
const getPort = require('get-port');
|
|
@@ -15,7 +14,7 @@ const net = require('net');
|
|
|
15
14
|
|
|
16
15
|
tmp.setGracefulCleanup();
|
|
17
16
|
|
|
18
|
-
const ENGINE_APP = '
|
|
17
|
+
const ENGINE_APP = os.platform() == 'win32' ? 'engine64.exe' : 'engine';
|
|
19
18
|
const NGINT_APP_PATH = '/bin/win64/ngint.exe';
|
|
20
19
|
const EXIT_CODE_RESTART_REQUIRED = 4;
|
|
21
20
|
const ENGINE_STATUS_URL = '/api/service-status/v1/status';
|
|
@@ -125,12 +124,7 @@ class Engine {
|
|
|
125
124
|
this.monitorTimeoutId_ = null;
|
|
126
125
|
}
|
|
127
126
|
this.monitorEnabled_ = true;
|
|
128
|
-
request.get(
|
|
129
|
-
protocol: 'http',
|
|
130
|
-
hostname: 'localhost',
|
|
131
|
-
port: this.httpPort,
|
|
132
|
-
pathname: ENGINE_STATUS_URL
|
|
133
|
-
}), (error, response) => {
|
|
127
|
+
request.get(`http://localhost:${this.httpPort}${ENGINE_STATUS_URL}`, (_error, response) => {
|
|
134
128
|
if (response && response.statusCode) {
|
|
135
129
|
this.lastStatusCode_ = response.statusCode;
|
|
136
130
|
if (this.lastStatusCode_ === 500) {
|
|
@@ -250,7 +244,7 @@ class Engine {
|
|
|
250
244
|
if (!httpUrl.startsWith('http://') && !httpUrl.startsWith('https://')) {
|
|
251
245
|
httpUrl = 'http://' + httpUrl;
|
|
252
246
|
}
|
|
253
|
-
request.get(
|
|
247
|
+
request.get(new URL(ENGINE_DOWNLOAD_URL, httpUrl).toString())
|
|
254
248
|
.pipe(fs.createWriteStream(this.enginePath))
|
|
255
249
|
.on('close', () => {
|
|
256
250
|
resolve();
|
|
@@ -506,7 +500,7 @@ class Engine {
|
|
|
506
500
|
const hash = crypto.createHash('sha256');
|
|
507
501
|
hash.update(os.hostname());
|
|
508
502
|
hash.update(getWorkspacePath());
|
|
509
|
-
return ('_' + hash.digest('hex').toUpperCase()).
|
|
503
|
+
return ('_' + hash.digest('hex').toUpperCase()).substring(0, INSTANCE_ID_LENGTH);
|
|
510
504
|
}
|
|
511
505
|
}
|
|
512
506
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nginstack/engine-node",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "60.0.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"thread-sleep": "^2.2.0",
|
|
25
25
|
"tmp": "^0.2.1"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "04220d66e188e03f53186458381d4303124a227a"
|
|
28
28
|
}
|