Manager: broadcast job/task updates in a separate goroutine

This commit is contained in:
Sybren A. Stüvel 2022-05-06 12:27:10 +02:00
parent cfab4f5b76
commit cd28ef552e

View File

@ -109,7 +109,7 @@ func (sm *StateMachine) taskStatusChangeOnly(
// Broadcast this change to the SocketIO clients.
taskUpdate := webupdates.NewTaskUpdate(task)
taskUpdate.PreviousStatus = &oldTaskStatus
sm.broadcaster.BroadcastTaskUpdate(taskUpdate)
go sm.broadcaster.BroadcastTaskUpdate(taskUpdate)
return nil
}
@ -281,7 +281,7 @@ func (sm *StateMachine) JobStatusChange(
// Broadcast this change to the SocketIO clients.
jobUpdate := webupdates.NewJobUpdate(job)
jobUpdate.PreviousStatus = &oldJobStatus
sm.broadcaster.BroadcastJobUpdate(jobUpdate)
go sm.broadcaster.BroadcastJobUpdate(jobUpdate)
}
return nil