Let daemon node call done() so it has time to kill child process

This commit is contained in:
Dave Conway-Jones 2017-01-01 23:34:23 +00:00
parent 31cb3d1e46
commit 83ea35d0dd
2 changed files with 4 additions and 3 deletions

View File

@ -86,11 +86,12 @@ module.exports = function(RED) {
}, 10000); // Restart after 10 secs if required
}
node.on("close", function() {
node.on("close", function(done) {
clearInterval(loop);
if (node.child != null) { node.child.kill('SIGKILL'); }
if (RED.settings.verbose) { node.log(node.cmd+" stopped"); }
clearInterval(loop);
node.status({});
setTimeout(function() { done(); }, 100);
});
runit();

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-daemon",
"version" : "0.0.9",
"version" : "0.0.10",
"description" : "A Node-RED node that runs and monitors a long running system command.",
"dependencies" : {
},