X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=inline;f=src%2Fworker%2FWorkerSet.ts;h=42109a98567609739d70a4e00c3c10d6e7420d07;hb=b3ded6aeb2468b6fa4fa7f456da929912626d8ec;hp=2514d7239a24dc01baeb98f22c8a492c0f574260;hpb=474d4ffcd45d49bb242f51510a28569b00328676;p=e-mobility-charging-stations-simulator.git diff --git a/src/worker/WorkerSet.ts b/src/worker/WorkerSet.ts index 2514d723..42109a98 100644 --- a/src/worker/WorkerSet.ts +++ b/src/worker/WorkerSet.ts @@ -77,15 +77,15 @@ export class WorkerSet extends WorkerAbstract { /** @inheritDoc */ public async stop(): Promise { for (const workerSetElement of this.workerSet) { + const worker = workerSetElement.worker; const workerExitPromise = new Promise((resolve) => { - workerSetElement.worker.on('exit', () => { + worker.on('exit', () => { resolve(); }); }); - await workerSetElement.worker.terminate(); + await worker.terminate(); await workerExitPromise; } - this.workerSet.clear(); } /** @inheritDoc */