Skip to content

Commit

Permalink
Merge pull request #4085 from node-red/link-call-timeout
Browse files Browse the repository at this point in the history
Clear link-call timeouts when node is closed
  • Loading branch information
knolleary committed Mar 2, 2023
2 parents 40b506b + 5e9a815 commit e7c6178
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/node_modules/@node-red/nodes/core/common/60-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e7c6178

Please sign in to comment.