mirror of
				https://github.com/node-red/node-red-nodes.git
				synced 2025-03-01 10:37:43 +00:00 
			
		
		
		
	tidy up Ping node close
This commit is contained in:
		@@ -49,12 +49,13 @@ module.exports = function(RED) {
 | 
			
		||||
                }
 | 
			
		||||
                var msg = { payload:false, topic:node.host };
 | 
			
		||||
                if (code === 0) { msg = { payload:res, topic:node.host }; }
 | 
			
		||||
                node.send(msg);
 | 
			
		||||
                try { node.send(msg); }
 | 
			
		||||
                catch(e) {}
 | 
			
		||||
            });
 | 
			
		||||
        }, node.timer);
 | 
			
		||||
 | 
			
		||||
        this.on("close", function() {
 | 
			
		||||
            clearInterval(this.tout);
 | 
			
		||||
            if (this.tout) { clearInterval(this.tout); }
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    RED.nodes.registerType("ping",PingNode);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
    "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.",
 | 
			
		||||
    "dependencies"  : {
 | 
			
		||||
    },
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user