Comparing version 4.1.1 to 4.2.0
# bedrock ChangeLog | ||
## 4.2.0 - 2021-06-30 | ||
## Added | ||
- Add POSIX signal handler to emit `bedrock.exit` event prior to exiting. | ||
## 4.1.1 - 2020-12-18 | ||
@@ -4,0 +9,0 @@ |
@@ -371,2 +371,33 @@ /*! | ||
function _setupSignalHandler(logger, logPrefix) { | ||
const SIGNALS = { | ||
/* | ||
The SIGHUP ("hang-up") signal is used to report that the | ||
user’s terminal is disconnected, perhaps because a network | ||
or telephone connection was broken. | ||
*/ | ||
SIGHUP: 1, | ||
/* | ||
The SIGINT (“program interrupt”) signal is sent | ||
when the user types the INTR character (normally C-c). | ||
*/ | ||
SIGINT: 2, | ||
/* | ||
The SIGTERM signal is a generic signal used to cause | ||
program termination. Unlike SIGKILL, this signal can | ||
be blocked, handled, and ignored. It is the normal way | ||
to politely ask a program to terminate. | ||
*/ | ||
SIGTERM: 15 | ||
}; | ||
Object.keys(SIGNALS).forEach(signal => { | ||
process.on(signal, async () => { | ||
logger.info(`${logPrefix} received signal.`, {signal}); | ||
await events.emit('bedrock.exit'); | ||
process.exit(); | ||
}); | ||
}); | ||
} | ||
function _runMaster(startTime, options) { | ||
@@ -394,2 +425,3 @@ // FIXME: use child logger | ||
_setupUncaughtExceptionHandler(logger, logPrefix); | ||
_setupSignalHandler(logger, logPrefix); | ||
@@ -465,2 +497,3 @@ logger.info( | ||
_setupUncaughtExceptionHandler(logger, logPrefix); | ||
_setupSignalHandler(logger, logPrefix); | ||
@@ -467,0 +500,0 @@ logger.info(`${logPrefix} starting process "${config.core.worker.title}"`); |
{ | ||
"name": "bedrock", | ||
"version": "4.1.1", | ||
"version": "4.2.0", | ||
"description": "A core foundation for rich Web applications.", | ||
@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE.md", |
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
151368
2287