mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
tidy up Ping node close
This commit is contained in:
parent
617e6809b5
commit
ce677d221b
@ -49,12 +49,13 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
var msg = { payload:false, topic:node.host };
|
var msg = { payload:false, topic:node.host };
|
||||||
if (code === 0) { msg = { payload:res, topic:node.host }; }
|
if (code === 0) { msg = { payload:res, topic:node.host }; }
|
||||||
node.send(msg);
|
try { node.send(msg); }
|
||||||
|
catch(e) {}
|
||||||
});
|
});
|
||||||
}, node.timer);
|
}, node.timer);
|
||||||
|
|
||||||
this.on("close", function() {
|
this.on("close", function() {
|
||||||
clearInterval(this.tout);
|
if (this.tout) { clearInterval(this.tout); }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
RED.nodes.registerType("ping",PingNode);
|
RED.nodes.registerType("ping",PingNode);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-ping",
|
"name" : "node-red-node-ping",
|
||||||
"version" : "0.0.6",
|
"version" : "0.0.7",
|
||||||
"description" : "A Node-RED node to ping a remote server, for use as a keep-alive check.",
|
"description" : "A Node-RED node to ping a remote server, for use as a keep-alive check.",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user