1
0
Fork 0

fix(api): include worker totals in status endpoint

This commit is contained in:
Sean Sube 2023-03-26 15:49:43 -05:00
parent 2d2283e1eb
commit 36bfccae09
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 14 additions and 0 deletions

View File

@ -369,6 +369,9 @@ class DevicePoolExecutor:
self.pending_jobs.append(job)
def status(self) -> Dict[str, List[Tuple[str, int, bool, bool, bool, bool]]]:
"""
Returns a tuple of: job/device, progress, progress, finished, cancelled, failed
"""
return {
"cancelled": [],
"finished": [
@ -404,6 +407,17 @@ class DevicePoolExecutor:
)
for name, job in self.running_jobs.items()
],
"total": [
(
device,
total,
self.workers[device].is_alive(),
False,
False,
False,
)
for device, total in self.total_jobs.items()
],
}
def next_job(self, device: str):