From ea2ee1f4fe0312a092b9aa88538aaecf423c908f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 10 Oct 2022 10:54:32 +0200 Subject: [PATCH] Fix fair share strategy unix timestamp comparison MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../selection-strategies/fair-share-worker-choice-strategy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 + -- 2.34.1