refactor: unflag worker startup at the right time on worker set
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 6 Aug 2023 10:40:22 +0000 (12:40 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 6 Aug 2023 10:40:22 +0000 (12:40 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/worker/WorkerSet.ts

index 12f29294ea54b98ad82b1cca9013662725f3c223..39e8eca388bdd402fb8f5d3c73e5d3eda960ba1f 100644 (file)
@@ -141,9 +141,9 @@ export class WorkerSet extends WorkerAbstract<WorkerData> {
     worker.once('exit', () =>
       this.removeWorkerSetElement(this.getWorkerSetElementByWorker(worker)!),
     );
-    this.workerStartup = false;
     const workerSetElement: WorkerSetElement = { worker, numberOfWorkerElements: 0 };
     this.workerSet.add(workerSetElement);
+    this.workerStartup = false;
     return workerSetElement;
   }