fix: ensure promise is awaited at pool destroy()
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 27 Feb 2023 20:10:41 +0000 (21:10 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 27 Feb 2023 20:10:41 +0000 (21:10 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/pools/abstract-pool.ts

index 4d572d0ab5ba351df0d936f88901d4f25335cacf..695c43b30d3f6697a5407a60ff3ceeca05248350 100644 (file)
@@ -218,7 +218,11 @@ export abstract class AbstractPool<
 
   /** {@inheritDoc} */
   public async destroy (): Promise<void> {
-    await Promise.all(this.workers.map(worker => this.destroyWorker(worker)))
+    await Promise.all(
+      this.workers.map(async worker => {
+        await this.destroyWorker(worker)
+      })
+    )
   }
 
   /**