mirror of https://github.com/node-red/node-red.git
Prevent RED.stop being called multiple times if >1 signal received
parent
fe4ef354ac
commit
6d294a0c74
|
@ -448,10 +448,14 @@ httpsPromise.then(function(startupHttps) {
|
|||
process.exit(1);
|
||||
});
|
||||
|
||||
var stopping = false;
|
||||
function exitWhenStopped() {
|
||||
RED.stop().then(function() {
|
||||
process.exit();
|
||||
});
|
||||
if (!stopping) {
|
||||
stopping = true;
|
||||
RED.stop().then(function() {
|
||||
process.exit();
|
||||
});
|
||||
}
|
||||
}
|
||||
process.on('SIGINT', exitWhenStopped);
|
||||
process.on('SIGTERM', exitWhenStopped);
|
||||
|
|
Loading…
Reference in New Issue