From c971418ebd546d9cd8cc77bd20c1a292ca1ba860 Mon Sep 17 00:00:00 2001 From: Johan Nyman Date: Tue, 7 May 2024 11:03:36 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Mint de Wit --- .../src/internalManager/lib/trackedWorkerAgents.ts | 1 + shared/packages/worker/src/workerAgent.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/shared/packages/expectationManager/src/internalManager/lib/trackedWorkerAgents.ts b/shared/packages/expectationManager/src/internalManager/lib/trackedWorkerAgents.ts index 0d6e47a9..3a5ef65e 100644 --- a/shared/packages/expectationManager/src/internalManager/lib/trackedWorkerAgents.ts +++ b/shared/packages/expectationManager/src/internalManager/lib/trackedWorkerAgents.ts @@ -124,6 +124,7 @@ export class TrackedWorkerAgents { const cost = await workerAgent.api.getCostForExpectation(trackedExp.exp) if (cost.cost !== null) { + // null means that the cost is "infinite" workerCosts.push({ worker: workerAgent.api, id: workerId, diff --git a/shared/packages/worker/src/workerAgent.ts b/shared/packages/worker/src/workerAgent.ts index 2ccd51a5..faf0d254 100644 --- a/shared/packages/worker/src/workerAgent.ts +++ b/shared/packages/worker/src/workerAgent.ts @@ -394,6 +394,7 @@ export class WorkerAgent { } let resultingCost: Cost = systemStartCost for (const job of this.currentJobs) { + // null means that the cost is "infinite" if (resultingCost === null) break if (job.cost.cost === null) resultingCost = null