Clear link-call timeouts when node is closed

Fixes #3959
This commit is contained in:
Nick O'Leary 2023-03-02 17:23:13 +00:00
parent 010c8eccc8
commit 5e9a815b06
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 8 additions and 0 deletions

View File

@ -248,6 +248,14 @@ module.exports = function(RED) {
}
});
this.on("close", function () {
for (const event of Object.values(messageEvents)) {
if (event.ts) {
clearTimeout(event.ts)
}
}
})
this.returnLinkMessage = function(eventId, msg) {
if (Array.isArray(msg._linkSource) && msg._linkSource.length === 0) {
delete msg._linkSource;