1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

rename BreakingExit call

(undo Brexit :-)
This commit is contained in:
Dave Conway-Jones 2020-02-05 13:58:45 +00:00
parent 0622be843b
commit b2f53a183e
No known key found for this signature in database
GPG Key ID: 302A6725C594817F

View File

@ -342,17 +342,17 @@ process.on('uncaughtException',function(err) {
process.exit(1);
});
function brexit() {
function exitWhenStopped() {
RED.stop().then(function() {
process.exit();
});
}
process.on('SIGINT', brexit);
process.on('SIGTERM', brexit);
process.on('SIGHUP', brexit);
process.on('SIGUSR2', brexit); // for nodemon restart
process.on('SIGBREAK', brexit); // for windows ctrl-break
process.on('SIGINT', exitWhenStopped);
process.on('SIGTERM', exitWhenStopped);
process.on('SIGHUP', exitWhenStopped);
process.on('SIGUSR2', exitWhenStopped); // for nodemon restart
process.on('SIGBREAK', exitWhenStopped); // for windows ctrl-break
process.on('message', function(m) { // for PM2 under window with --shutdown-with-message
if (m === 'shutdown') { brexit }
if (m === 'shutdown') { exitWhenStopped }
});