@nginstack/engine-node 60.0.5 → 60.0.8

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.
Files changed (2) hide show
  1. package/lib/Engine.js +5 -1
  2. package/package.json +2 -2
package/lib/Engine.js CHANGED
@@ -78,6 +78,7 @@ class Engine {
78
78
  this.v8_ = options.v8 || false;
79
79
  this.startupTimeout = options.startupTimeout || ENGINE_STARTUP_TIMEOUT;
80
80
  this.startedSuccessfully = false;
81
+ this.inShutdown_ = false;
81
82
  this.redirectLogsToStdout_ = options.redirectLogsToStdout || false;
82
83
  this.onEngineClose_ = null;
83
84
  if (options.instanceId) {
@@ -127,7 +128,7 @@ class Engine {
127
128
  request.get(`http://localhost:${this.httpPort}${ENGINE_STATUS_URL}`, (_error, response) => {
128
129
  if (response && response.statusCode) {
129
130
  this.lastStatusCode_ = response.statusCode;
130
- if (this.lastStatusCode_ === 500) {
131
+ if (this.lastStatusCode_ === 500 && !this.inShutdown_) {
131
132
  console.info(`Engine response (${response.statusCode}):\n${response.body}`);
132
133
  }
133
134
  } else {
@@ -326,6 +327,7 @@ class Engine {
326
327
  args.push('--additionalLoggerConfig=\'' + logConfig + '\'');
327
328
  }
328
329
 
330
+ this.inShutdown_ = false;
329
331
  this.process_ = child_process.spawn(path.join(this.installPath, ENGINE_APP),
330
332
  args,
331
333
  {
@@ -422,6 +424,7 @@ class Engine {
422
424
  } else {
423
425
  resolve();
424
426
  }
427
+ this.inShutdown_ = false;
425
428
  };
426
429
  this.sendShutdownCommand_();
427
430
  } else {
@@ -437,6 +440,7 @@ class Engine {
437
440
  sendShutdownCommand_() {
438
441
  if (this.process_) {
439
442
  let forceKill = true;
443
+ this.inShutdown_ = true;
440
444
  if (os.platform() == 'win32') {
441
445
  if (fs.existsSync(this.ngintPath_)) {
442
446
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nginstack/engine-node",
3
- "version": "60.0.5",
3
+ "version": "60.0.8",
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": "ac2f2455aca88917f9e76fa2214f82f9fa9ef1c1"
27
+ "gitHead": "827772c130491ba242eabe4dff2d42d6d309bc37"
28
28
  }