X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Finterleaved-weighted-round-robin-worker-choice-strategy.ts;h=b1abe98772d88ce295b17aa6be653a332dd11b04;hb=b358c8aca5934f7d5dc4bd234d1909ba13850ea9;hp=97a3aa04e5b941a31a053c53bf3f4416d15855f0;hpb=e372f3935374fbbea3a5d3acc72813b36ced86ff;p=poolifier.git diff --git a/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts b/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts index 97a3aa04..b1abe987 100644 --- a/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts @@ -1,6 +1,6 @@ -import type { IWorker } from '../worker.js' import type { IPool } from '../pool.js' -import { DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS } from '../../utils.js' +import { DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS } from '../utils.js' +import type { IWorker } from '../worker.js' import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy.js' import type { IWorkerChoiceStrategy, @@ -133,7 +133,10 @@ export class InterleavedWeightedRoundRobinWorkerChoiceStrategy< /** @inheritDoc */ public remove (workerNodeKey: number): boolean { if (this.pool.workerNodes.length === 0) { - this.reset() + this.resetWorkerNodeKeyProperties() + this.workerNodeId = 0 + this.workerNodeVirtualTaskRunTime = 0 + return true } if ( this.workerNodeId === workerNodeKey &&