Merge pull request #5014 from node-red/5013-switch-call-stack-fix

Avoid exceeding call stack when draining message group in Switch
This commit is contained in:
Nick O'Leary 2025-01-17 16:48:17 +00:00 committed by GitHub
commit 272355a48e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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()
})
});
}