fix: flag worker set as stopped as soon the stopped event is emitted
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 11 Feb 2024 18:27:38 +0000 (19:27 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 11 Feb 2024 18:27:38 +0000 (19:27 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/worker/WorkerSet.ts

index f22f195379616c32494623668030a7c8d32de2bd..4a43e27b0601c44d3035c77411640cefd2fe798a 100644 (file)
@@ -97,9 +97,9 @@ export class WorkerSet extends WorkerAbstract<WorkerData> {
       await waitWorkerExit
     }
     this.emitter?.emit(WorkerSetEvents.stopped, this.info)
+    this.started = false
     this.emitter?.emitDestroy()
     this.emitter?.removeAllListeners()
-    this.started = false
   }
 
   /** @inheritDoc */