fix(api): include worker totals in status endpoint
This commit is contained in:
parent
2d2283e1eb
commit
36bfccae09
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue