Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Oct 1, 2024
1 parent f3f1239 commit 33e1b5f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pioreactorui/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,22 @@ def run_job_on_unit_in_experiment(
json = request.get_json()

if pioreactor_unit == "$broadcast":
broadcast_post_across_cluster(f"/unit_api/jobs/run/job_name/{job}", json=json)
workers = query_app_db(
"""
SELECT w.pioreactor_unit as worker
FROM experiment_worker_assignments a
JOIN workers w
on w.pioreactor_unit = a.pioreactor_unit
WHERE experiment = ?
ORDER BY w.pioreactor_unit
""",
(experiment,),
)
assert isinstance(workers, list)
assigned_workers = [w["worker"] for w in workers]
tasks.multicast_post_across_cluster(
f"/unit_api/jobs/run/job_name/{job}", assigned_workers, json=json
)

else:
tasks.multicast_post_across_cluster(
Expand Down

0 comments on commit 33e1b5f

Please sign in to comment.