mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
parent
c0e7d6d826
commit
8e9815fb91
@ -33,9 +33,7 @@ module.exports = function(RED) {
|
|||||||
*/
|
*/
|
||||||
const enqueue = (queue, item) => {
|
const enqueue = (queue, item) => {
|
||||||
// drop msgs from front of queue if size is going to be exceeded
|
// drop msgs from front of queue if size is going to be exceeded
|
||||||
if (queue.size() === msgQueueSize) {
|
if (queue.size() === msgQueueSize) { queue.shift(); }
|
||||||
queue.shift();
|
|
||||||
}
|
|
||||||
queue.push(item);
|
queue.push(item);
|
||||||
return queue;
|
return queue;
|
||||||
};
|
};
|
||||||
@ -646,7 +644,7 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
else if (!clients[connection_id].connecting && clients[connection_id].connected) {
|
else if (!clients[connection_id].connecting && clients[connection_id].connected) {
|
||||||
if (clients[connection_id] && clients[connection_id].client) {
|
if (clients[connection_id] && clients[connection_id].client) {
|
||||||
clients[connection_id].client.write(dequeue(clients[connection_id].msgQueue));
|
clients[connection_id].client.write(dequeue(clients[connection_id].msgQueue).payload);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user