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) (#3723)

(cherry picked from commit cda5f94)

Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com>
  • Loading branch information
github-actions[bot] and Uzlopak authored Oct 12, 2024
1 parent a699105 commit fd32a55
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 fd32a55

Please sign in to comment.