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

Delay node dropping intermediate messages incorrectly

This commit is contained in:
Nick O'Leary 2014-05-06 09:58:30 +01:00
parent 7c5baac192
commit baaf8167d3

View File

@ -80,6 +80,7 @@ module.exports = function(RED) {
this.intervalID = -1; this.intervalID = -1;
this.randomID = -1; this.randomID = -1;
this.lastSent = Date.now(); this.lastSent = Date.now();
this.drop = n.drop;
var node = this; var node = this;
if (this.pauseType === "delay") { if (this.pauseType === "delay") {
@ -101,7 +102,7 @@ module.exports = function(RED) {
} else if (this.pauseType === "rate") { } else if (this.pauseType === "rate") {
this.on("input", function(msg) { this.on("input", function(msg) {
if (node.drop) { if (!node.drop) {
if ( node.intervalID !== -1) { if ( node.intervalID !== -1) {
node.buffer.push(msg); node.buffer.push(msg);
if (node.buffer.length > 1000) { if (node.buffer.length > 1000) {