From: Jérôme Benoit Date: Mon, 10 Oct 2022 08:54:32 +0000 (+0200) Subject: Fix fair share strategy unix timestamp comparison X-Git-Tag: v2.3.1~44 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ea2ee1f4fe0312a092b9aa88538aaecf423c908f;p=poolifier.git Fix fair share strategy unix timestamp comparison Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/selection-strategies/fair-share-worker-choice-strategy.ts b/src/pools/selection-strategies/fair-share-worker-choice-strategy.ts index f8f18212..0d4773ff 100644 --- a/src/pools/selection-strategies/fair-share-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/fair-share-worker-choice-strategy.ts @@ -61,7 +61,7 @@ export class FairShareWorkerChoiceStrategy< for (const worker of this.pool.workers) { const workerVirtualTaskStartTimestamp = Math.max( Date.now(), - this.workerLastVirtualTaskTimestamp.get(worker)?.end ?? 0 + this.workerLastVirtualTaskTimestamp.get(worker)?.end ?? -Infinity ) const workerVirtualTaskEndTimestamp = workerVirtualTaskStartTimestamp +