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:
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)
|
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:
|
// Convert database objects to API objects:
|
||||||
apiCommands := []api.Command{}
|
apiCommands := []api.Command{}
|
||||||
for _, cmd := range dbTask.Commands {
|
for _, cmd := range dbTask.Commands {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user