fix(simulation): cache idle worker state
This commit is contained in:
@@ -637,9 +637,8 @@ class SimulationWorkerAgent:
|
||||
)
|
||||
|
||||
def _active_run(self) -> QualificationRun | None:
|
||||
cached: QualificationRun | None = getattr(self, "_active_run_cache", None)
|
||||
if cached is not None:
|
||||
return cached
|
||||
if hasattr(self, "_active_run_cache"):
|
||||
return self._active_run_cache
|
||||
active = tuple(run for run in self.store.list_runs() if run.state in ACTIVE_STATES)
|
||||
if len(active) > 1:
|
||||
raise WorkerAgentError("multiple active qualification runs violate worker authority")
|
||||
|
||||
Reference in New Issue
Block a user