1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00

revert ping changes for HA

to address #662
This commit is contained in:
Dave Conway-Jones 2020-11-20 18:07:35 +00:00
parent 4884550215
commit 2d5d553c4d
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
2 changed files with 15 additions and 20 deletions

View File

@ -43,12 +43,9 @@ module.exports = function(RED) {
var spawnTout = setTimeout(() => {
node.log(`ping - Host '${hostOptions.host}' process timeout - sending SIGINT`)
try {
if (ex && ex.pid) {
ex.removeAllListeners();
ex.kill("SIGINT");
if (ex && ex.pid) { ex.kill("SIGINT"); }
}
}
catch(e) { console.warn(e) }
catch(e) {console.warn(e); }
}, hostOptions.timeout+1000); //add 1s for grace
var res = false;
@ -56,11 +53,9 @@ module.exports = function(RED) {
var fail = false;
//var regex = /from.*time.(.*)ms/;
var regex = /=.*[<|=]([0-9]*).*TTL|ttl..*=([0-9\.]*)/;
if (ex && ex.hasOwnProperty("stdout")) {
ex.stdout.on("data", function (data) {
line += data.toString();
});
}
ex.on("exit", function (err) {
clearTimeout(spawnTout);
});

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-ping",
"version" : "0.2.1",
"version" : "0.2.2",
"description" : "A Node-RED node to ping a remote server, for use as a keep-alive check.",
"dependencies" : {
},