From: Jérôme Benoit Date: Mon, 27 Feb 2023 20:10:41 +0000 (+0100) Subject: fix: ensure promise is awaited at pool destroy() X-Git-Tag: v2.3.8~15 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=1fbcaa7ca91d26b311689a5e698402bd157a9152;p=poolifier.git fix: ensure promise is awaited at pool destroy() Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 4d572d0a..695c43b3 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -218,7 +218,11 @@ export abstract class AbstractPool< /** {@inheritDoc} */ public async destroy (): Promise { - await Promise.all(this.workers.map(worker => this.destroyWorker(worker))) + await Promise.all( + this.workers.map(async worker => { + await this.destroyWorker(worker) + }) + ) } /**