]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
refactor: cleanup eslint-disable
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 20 Aug 2025 11:29:08 +0000 (13:29 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 20 Aug 2025 11:29:08 +0000 (13:29 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/worker/WorkerSet.ts

index b0f29e64f954943a60a9964834d08a7f8e587492..e777fe6521c89b1428d160303c3ddc9604765376 100644 (file)
@@ -118,10 +118,9 @@ export class WorkerSet<D extends WorkerData, R extends WorkerData> extends Worke
   public async start (): Promise<void> {
     this.addWorkerSetElement()
     // Add worker set element sequentially to optimize memory at startup
-    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
-    this.workerOptions.workerStartDelay! > 0 &&
-      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
-      (await sleep(randomizeDelay(this.workerOptions.workerStartDelay!)))
+    if (this.workerOptions.workerStartDelay != null && this.workerOptions.workerStartDelay > 0) {
+      await sleep(randomizeDelay(this.workerOptions.workerStartDelay))
+    }
     this.started = true
     this.emitter?.emit(WorkerSetEvents.started, this.info)
   }