Add live activity progress and logs
This commit is contained in:
@@ -141,6 +141,16 @@ func (q *Queue) Snapshot() []model.Run {
|
||||
return q.snapshotLocked()
|
||||
}
|
||||
|
||||
func (q *Queue) UpdateActive(id string, update func(*model.Run)) bool {
|
||||
q.mu.Lock()
|
||||
defer q.mu.Unlock()
|
||||
if q.active == nil || q.active.ID != id {
|
||||
return false
|
||||
}
|
||||
update(q.active)
|
||||
return true
|
||||
}
|
||||
|
||||
func (q *Queue) snapshotLocked() []model.Run {
|
||||
result := append([]model.Run{}, q.history...)
|
||||
if q.active != nil {
|
||||
|
||||
Reference in New Issue
Block a user