fix: graceful shutdown (#3821)

* fix: missing graceful shutdown handler

* fix: asar - use async fs operation

* fix: scheduler - graceful shutdown and wait for running jobs to complete
This commit is contained in:
LK HO
2021-04-12 23:45:33 +08:00
committed by GitHub
parent 71aa0c9346
commit a103127545
4 changed files with 39 additions and 23 deletions

View File

@@ -33,3 +33,16 @@ WIKI.logger = require('./core/logger').init('MASTER')
// ----------------------------------------
WIKI.kernel.init()
// ----------------------------------------
// Register exit handler
// ----------------------------------------
process.on('SIGINT', () => {
WIKI.kernel.shutdown()
})
process.on('message', (msg) => {
if (msg === 'shutdown') {
WIKI.kernel.shutdown()
}
})