mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Tidy up code removal
This commit is contained in:
		@@ -291,27 +291,23 @@ module.exports = function(RED) {
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                else if (!msg.hasOwnProperty("reset")) {
 | 
			
		||||
                    if (maxKeptMsgsCount(node) > 0 && !node.drop) {
 | 
			
		||||
                    if (node.allowrate && msg.hasOwnProperty("rate") && !isNaN(parseFloat(msg.rate))) {
 | 
			
		||||
                        node.rate = msg.rate;
 | 
			
		||||
                    }
 | 
			
		||||
                    else {
 | 
			
		||||
                        if (node.allowrate && msg.hasOwnProperty("rate") && !isNaN(parseFloat(msg.rate))) {
 | 
			
		||||
                            node.rate = msg.rate;
 | 
			
		||||
                        }
 | 
			
		||||
                        var timeSinceLast;
 | 
			
		||||
                        if (node.lastSent) {
 | 
			
		||||
                            timeSinceLast = process.hrtime(node.lastSent);
 | 
			
		||||
                        }
 | 
			
		||||
                        if (!node.lastSent) { // ensuring that we always send the first message
 | 
			
		||||
                            node.lastSent = process.hrtime();
 | 
			
		||||
                            send(msg);
 | 
			
		||||
                        }
 | 
			
		||||
                        else if ( ( (timeSinceLast[0] * SECONDS_TO_NANOS) + timeSinceLast[1] ) > (node.rate * MILLIS_TO_NANOS) ) {
 | 
			
		||||
                            node.lastSent = process.hrtime();
 | 
			
		||||
                            send(msg);
 | 
			
		||||
                        }
 | 
			
		||||
                        else if (node.outputs === 2) {
 | 
			
		||||
                            send([null,msg])
 | 
			
		||||
                        }
 | 
			
		||||
                    var timeSinceLast;
 | 
			
		||||
                    if (node.lastSent) {
 | 
			
		||||
                        timeSinceLast = process.hrtime(node.lastSent);
 | 
			
		||||
                    }
 | 
			
		||||
                    if (!node.lastSent) { // ensuring that we always send the first message
 | 
			
		||||
                        node.lastSent = process.hrtime();
 | 
			
		||||
                        send(msg);
 | 
			
		||||
                    }
 | 
			
		||||
                    else if ( ( (timeSinceLast[0] * SECONDS_TO_NANOS) + timeSinceLast[1] ) > (node.rate * MILLIS_TO_NANOS) ) {
 | 
			
		||||
                        node.lastSent = process.hrtime();
 | 
			
		||||
                        send(msg);
 | 
			
		||||
                    }
 | 
			
		||||
                    else if (node.outputs === 2) {
 | 
			
		||||
                        send([null,msg])
 | 
			
		||||
                    }
 | 
			
		||||
                    done();
 | 
			
		||||
                }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user