Avoid exceeding call stack when draining message group in Switch

Fixes #5013
This commit is contained in:
Nick O'Leary 2025-01-13 16:37:35 +00:00
parent 1e8f840993
commit 953b7584a3
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -352,7 +352,9 @@ module.exports = function(RED) {
if (msgs.length === 0) {
done()
} else {
setImmediate(() => {
drainMessageGroup(msgs,count,done);
})
}
}
})
@ -505,7 +507,9 @@ module.exports = function(RED) {
if (err) {
node.error(err,nextMsg);
}
setImmediate(() => {
processMessageQueue()
})
});
}