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
10
packages/node_modules/node-red/red.js
vendored
10
packages/node_modules/node-red/red.js
vendored
@ -448,10 +448,14 @@ httpsPromise.then(function(startupHttps) {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var stopping = false;
|
||||||
function exitWhenStopped() {
|
function exitWhenStopped() {
|
||||||
RED.stop().then(function() {
|
if (!stopping) {
|
||||||
process.exit();
|
stopping = true;
|
||||||
});
|
RED.stop().then(function() {
|
||||||
|
process.exit();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
process.on('SIGINT', exitWhenStopped);
|
process.on('SIGINT', exitWhenStopped);
|
||||||
process.on('SIGTERM', exitWhenStopped);
|
process.on('SIGTERM', exitWhenStopped);
|
||||||
|
Loading…
Reference in New Issue
Block a user