Skip to content

Commit

Permalink
fix(api): exclude finished jobs when load balancing
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Feb 4, 2023
1 parent de6e3b4 commit ed2e15a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/onnx_web/device_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def get_next_device(self):
if len(self.jobs) == 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.update(job_devices)

Expand Down

0 comments on commit ed2e15a

Please sign in to comment.