build(deps-dev): apply updates
[poolifier.git] / src / pools / selection-strategies / abstract-worker-choice-strategy.ts
index b9f6e721dca46a192d86aa006eef6df0ef834e8f..5172a181a507fad13940216c933646c616ddb3fa 100644 (file)
@@ -13,8 +13,8 @@ import type {
  * Worker choice strategy abstract base class.
  *
  * @typeParam Worker - Type of worker which manages the strategy.
- * @typeParam Data - Type of data sent to the worker. This can only be serializable data.
- * @typeParam Response - Type of execution response. This can only be serializable data.
+ * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
  */
 export abstract class AbstractWorkerChoiceStrategy<
   Worker extends IWorker,
@@ -133,9 +133,8 @@ export abstract class AbstractWorkerChoiceStrategy<
 
   /** @inheritDoc */
   public setOptions (opts: WorkerChoiceStrategyOptions): void {
-    opts = opts ?? DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
-    this.setTaskStatisticsRequirements(opts)
-    this.opts = opts
+    this.opts = opts ?? DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
+    this.setTaskStatisticsRequirements(this.opts)
   }
 
   // /**
@@ -176,8 +175,8 @@ export abstract class AbstractWorkerChoiceStrategy<
    */
   protected getWorkerTaskWaitTime (workerNodeKey: number): number {
     return this.taskStatisticsRequirements.waitTime.median
-      ? this.pool.workerNodes[workerNodeKey].workerUsage.runTime.median
-      : this.pool.workerNodes[workerNodeKey].workerUsage.runTime.average
+      ? this.pool.workerNodes[workerNodeKey].workerUsage.waitTime.median
+      : this.pool.workerNodes[workerNodeKey].workerUsage.waitTime.average
   }
 
   /**