From 1fbcaa7ca91d26b311689a5e698402bd157a9152 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 27 Feb 2023 21:10:41 +0100 Subject: [PATCH] fix: ensure promise is awaited at pool destroy() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/abstract-pool.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) + }) + ) } /** -- 2.34.1