egg-cluster
Advanced tools
Comparing version 1.20.0 to 1.21.0
1.21.0 / 2018-09-28 | ||
=================== | ||
* feat: graceful exit when boot failed (#78) | ||
1.20.0 / 2018-09-17 | ||
@@ -3,0 +8,0 @@ =================== |
@@ -33,3 +33,4 @@ 'use strict'; | ||
consoleLogger.error('[agent_worker] start error, exiting with code:1'); | ||
process.exit(1); | ||
process.exitCode = 1; | ||
process.kill(process.pid); | ||
} | ||
@@ -36,0 +37,0 @@ |
@@ -17,3 +17,2 @@ 'use strict'; | ||
const consoleLogger = new ConsoleLogger({ level: process.env.EGG_APP_WORKER_LOGGER_LEVEL }); | ||
const Application = require(options.framework).Application; | ||
@@ -28,2 +27,8 @@ debug('new Application with options %j', options); | ||
function exitProcess() { | ||
// Use SIGTERM kill process, ensure trigger the gracefulExit | ||
process.exitCode = 1; | ||
process.kill(process.pid); | ||
} | ||
// exit if worker start timeout | ||
@@ -33,3 +38,3 @@ app.once('startTimeout', startTimeoutHandler); | ||
consoleLogger.error('[app_worker] start timeout, exiting with code:1'); | ||
process.exit(1); | ||
exitProcess(); | ||
} | ||
@@ -41,3 +46,4 @@ | ||
consoleLogger.error('[app_worker] start error, exiting with code:1'); | ||
process.exit(1); | ||
exitProcess(); | ||
return; | ||
} | ||
@@ -60,3 +66,3 @@ | ||
consoleLogger.error('[app_worker] server got error: %s, code: %s', err.message, err.code); | ||
process.exit(1); | ||
exitProcess(); | ||
}); | ||
@@ -86,3 +92,4 @@ | ||
consoleLogger.error('[app_worker] port should be number, but got %s(%s)', port, typeof port); | ||
process.exit(1); | ||
exitProcess(); | ||
return; | ||
} | ||
@@ -89,0 +96,0 @@ const args = [ port ]; |
{ | ||
"name": "egg-cluster", | ||
"version": "1.20.0", | ||
"version": "1.21.0", | ||
"description": "cluster manager for egg", | ||
@@ -72,4 +72,4 @@ "main": "index.js", | ||
"ci": { | ||
"version": "6, 8" | ||
"version": "6, 8, 10" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46787
958