fix(simulator): register worker_threads exit handler once
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 20 Sep 2023 17:27:43 +0000 (19:27 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 20 Sep 2023 17:27:43 +0000 (19:27 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/worker/WorkerSet.ts

index 82e2e8369083c54b572e5e99c2a99abd25b0d877..7f140527d365bf12dd5b985e3d8c2c583a10de3f 100644 (file)
@@ -86,7 +86,7 @@ export class WorkerSet extends WorkerAbstract<WorkerData> {
     for (const workerSetElement of this.workerSet) {
       const worker = workerSetElement.worker;
       const waitWorkerExit = new Promise<void>((resolve) => {
-        worker.on('exit', () => {
+        worker.once('exit', () => {
           resolve();
         });
       });