Add activity history clearing
This commit is contained in:
@@ -151,6 +151,15 @@ func (q *Queue) UpdateActive(id string, update func(*model.Run)) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (q *Queue) ClearHistory() int {
|
||||
q.mu.Lock()
|
||||
defer q.mu.Unlock()
|
||||
count := len(q.history)
|
||||
q.history = nil
|
||||
q.emitLocked()
|
||||
return count
|
||||
}
|
||||
|
||||
func (q *Queue) snapshotLocked() []model.Run {
|
||||
result := append([]model.Run{}, q.history...)
|
||||
if q.active != nil {
|
||||
|
||||
Reference in New Issue
Block a user