Skip to content

Commit

Permalink
Prevent RED.stop being called multiple times if >1 signal received
Browse files Browse the repository at this point in the history
  • Loading branch information
knolleary committed Jun 9, 2020
1 parent fe4ef35 commit 6d294a0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/node_modules/node-red/red.js
Expand Up @@ -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);
Expand Down

0 comments on commit 6d294a0

Please sign in to comment.