From: Jérôme Benoit Date: Wed, 20 Sep 2023 17:27:43 +0000 (+0200) Subject: fix(simulator): register worker_threads exit handler once X-Git-Tag: v1.2.23~37 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ae3a41a14998703948ee01108e346f91f7f33e48;p=e-mobility-charging-stations-simulator.git fix(simulator): register worker_threads exit handler once Signed-off-by: Jérôme Benoit --- diff --git a/src/worker/WorkerSet.ts b/src/worker/WorkerSet.ts index 82e2e836..7f140527 100644 --- a/src/worker/WorkerSet.ts +++ b/src/worker/WorkerSet.ts @@ -86,7 +86,7 @@ export class WorkerSet extends WorkerAbstract { for (const workerSetElement of this.workerSet) { const worker = workerSetElement.worker; const waitWorkerExit = new Promise((resolve) => { - worker.on('exit', () => { + worker.once('exit', () => { resolve(); }); });