Skip to content

Commit

Permalink
fix: PoolBase kClose and kDestroy should await and not return the Pro…
Browse files Browse the repository at this point in the history
…mise (#3716)
  • Loading branch information
Uzlopak authored Oct 11, 2024
1 parent 9c3ed66 commit cda5f94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/dispatcher/pool-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ class PoolBase extends DispatcherBase {

async [kClose] () {
if (this[kQueue].isEmpty()) {
return Promise.all(this[kClients].map(c => c.close()))
await Promise.all(this[kClients].map(c => c.close()))
} else {
return new Promise((resolve) => {
await new Promise((resolve) => {
this[kClosedResolve] = resolve
})
}
Expand All @@ -130,7 +130,7 @@ class PoolBase extends DispatcherBase {
item.handler.onError(err)
}

return Promise.all(this[kClients].map(c => c.destroy(err)))
await Promise.all(this[kClients].map(c => c.destroy(err)))
}

[kDispatch] (opts, handler) {
Expand Down

0 comments on commit cda5f94

Please sign in to comment.