Remove matching worker set element when a worker exit.
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 15 Feb 2021 16:36:51 +0000 (17:36 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 15 Feb 2021 16:36:51 +0000 (17:36 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/worker/WorkerSet.ts

index c550149b71b5945e50058b8a6f27c1d72bf88275..6ea0a05964d2af13370c23c0dbb7b60ae0246775 100644 (file)
@@ -79,7 +79,7 @@ export default class WorkerSet<T> extends Wrk {
       if (code !== 0) {
         console.error(`Worker stopped with exit code ${code}`);
       }
-      // FIXME: remove matching worker set element
+      this.workerSet.delete(this.getWorkerSetElementByWorker(worker));
     });
     this.workerSet.add({ worker, numberOfWorkerElements: 0 });
   }