Manager: broadcast worker update after assigning task

The Manager now broadcasts a worker update to SocketIO clients when a
worker gets a new task assigned. This ensures the "current task" shown in
the worker details view is up to date.
This commit is contained in:
Sybren A. Stüvel 2022-08-01 14:29:00 +02:00
parent cb1e991305
commit 449c83b94a

@ -340,6 +340,10 @@ func (f *Flamenco) ScheduleTask(e echo.Context) error {
return sendAPIError(e, http.StatusInternalServerError, "internal error updating task for timeout calculation: %v", err)
}
// Broadcast a worker update so that the web frontend will show the newly assigned task.
update := webupdates.NewWorkerUpdate(worker)
f.broadcaster.BroadcastWorkerUpdate(update)
// Convert database objects to API objects:
apiCommands := []api.Command{}
for _, cmd := range dbTask.Commands {