From: Jérôme Benoit Date: Sat, 22 Jul 2023 12:40:52 +0000 (+0200) Subject: refactor(simulator): cleanup worker set variable namespace X-Git-Tag: v1.2.20~169 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=bd62e88fd15e6e1452d69e9f32240e38be8cf743;p=e-mobility-charging-stations-simulator.git refactor(simulator): cleanup worker set variable namespace Signed-off-by: Jérôme Benoit --- diff --git a/src/worker/WorkerSet.ts b/src/worker/WorkerSet.ts index 42109a98..fd81840a 100644 --- a/src/worker/WorkerSet.ts +++ b/src/worker/WorkerSet.ts @@ -78,13 +78,13 @@ export class WorkerSet extends WorkerAbstract { public async stop(): Promise { for (const workerSetElement of this.workerSet) { const worker = workerSetElement.worker; - const workerExitPromise = new Promise((resolve) => { + const waitWorkerExit = new Promise((resolve) => { worker.on('exit', () => { resolve(); }); }); await worker.terminate(); - await workerExitPromise; + await waitWorkerExit; } }