do add to queue in case it needs to also be flushed

This commit is contained in:
Dave Conway-Jones 2024-10-31 17:21:53 +00:00
parent 33a5b2527c
commit d3219f0600
No known key found for this signature in database
GPG Key ID: 1DDB0E91A28C2643

View File

@ -253,11 +253,15 @@ module.exports = function(RED) {
if (node.allowrate && m.hasOwnProperty("rate") && !isNaN(parseFloat(m.rate))) {
node.rate = m.rate;
}
if (!msg.hasOwnProperty("reset")) {
send(m);
node.reportDepth();
node.intervalID = setInterval(sendMsgFromBuffer, node.rate);
if (msg.hasOwnProperty("reset")) {
if (msg.hasOwnProperty("flush")) {
node.buffer.push({msg: m, send: send, done: done});
}
}
else { send(m); }
node.reportDepth();
node.intervalID = setInterval(sendMsgFromBuffer, node.rate);
done();
}
}