1
0
Fork 0

fix(api): exclude finished jobs when load balancing

This commit is contained in:
Sean Sube 2023-02-04 16:54:44 -06:00
parent de6e3b4e27
commit ed2e15a67e
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 1 additions and 1 deletions

View File

@ -139,7 +139,7 @@ class DevicePoolExecutor:
if len(self.jobs) == 0: if len(self.jobs) == 0:
return 0 return 0
job_devices = [job.context.device_index.value for job in self.jobs] job_devices = [job.context.device_index.value for job in self.jobs if not job.future.done()]
job_counts = Counter(range(len(self.devices))) job_counts = Counter(range(len(self.devices)))
job_counts.update(job_devices) job_counts.update(job_devices)