mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Prevent RED.stop being called multiple times if >1 signal received
This commit is contained in:
parent
fe4ef354ac
commit
6d294a0c74
4
packages/node_modules/node-red/red.js
vendored
4
packages/node_modules/node-red/red.js
vendored
@ -448,11 +448,15 @@ httpsPromise.then(function(startupHttps) {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var stopping = false;
|
||||||
function exitWhenStopped() {
|
function exitWhenStopped() {
|
||||||
|
if (!stopping) {
|
||||||
|
stopping = true;
|
||||||
RED.stop().then(function() {
|
RED.stop().then(function() {
|
||||||
process.exit();
|
process.exit();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
process.on('SIGINT', exitWhenStopped);
|
process.on('SIGINT', exitWhenStopped);
|
||||||
process.on('SIGTERM', exitWhenStopped);
|
process.on('SIGTERM', exitWhenStopped);
|
||||||
process.on('SIGHUP', exitWhenStopped);
|
process.on('SIGHUP', exitWhenStopped);
|
||||||
|
Loading…
Reference in New Issue
Block a user