fishtest
fishtest copied to clipboard
get_machines is too slow and does not use the book keeping data
https://tests.stockfishchess.org/tests/machines This route should use the latest optimizations of workers book-keeping if exists It's also too slow under fleet load, ignoring the 10s cached http resposne
def get_machines(self):
active_runs = self.runs.find({"finished": False}, {"tasks": 1, "args": 1})
machines = (
task["worker_info"]
| {
"last_updated": (
task["last_updated"] if task.get("last_updated") else None
),
"run": run,
"task_id": task_id,
}
for run in active_runs
if any(task["active"] for task in reversed(run["tasks"]))
for task_id, task in enumerate(run["tasks"])
if task["active"]
)
return machines