X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Fabstract-worker-choice-strategy.ts;h=5172a181a507fad13940216c933646c616ddb3fa;hb=ae46e139246f3d30c073d78a06e817ca8bd02b36;hp=b9f6e721dca46a192d86aa006eef6df0ef834e8f;hpb=1d6d93ce602a45fe649335f4933c698573715df1;p=poolifier.git diff --git a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts index b9f6e721..5172a181 100644 --- a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts @@ -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 } /**