Skip to content

Commit

Permalink
Clear all timeout on destroy and close (#2535)
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
mcollina committed Dec 23, 2023
1 parent f51f917 commit a1a8136
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/agent.js
Expand Up @@ -110,6 +110,9 @@ class Agent extends DispatcherBase {
async [kClose] () {
const closePromises = []
for (const client of this[kClients].values()) {
if (client[kDeleteScheduled]) {

Check failure on line 113 in lib/agent.js

View workflow job for this annotation

GitHub Actions / lint

'kDeleteScheduled' is not defined
clearTimeout(client[kDeleteScheduled])

Check failure on line 114 in lib/agent.js

View workflow job for this annotation

GitHub Actions / lint

'kDeleteScheduled' is not defined
}
closePromises.push(client.close())
}
this[kClients].clear()
Expand All @@ -120,6 +123,9 @@ class Agent extends DispatcherBase {
async [kDestroy] (err) {
const destroyPromises = []
for (const client of this[kClients].values()) {
if (client[kDeleteScheduled]) {

Check failure on line 126 in lib/agent.js

View workflow job for this annotation

GitHub Actions / lint

'kDeleteScheduled' is not defined
clearTimeout(client[kDeleteScheduled])

Check failure on line 127 in lib/agent.js

View workflow job for this annotation

GitHub Actions / lint

'kDeleteScheduled' is not defined
}
destroyPromises.push(client.destroy(err))
}
this[kClients].clear()
Expand Down

0 comments on commit a1a8136

Please sign in to comment.