Fix 'Clear Completed' to preserve running jobs
Removed cancelRunningLocked() call from Clear() method. Now 'Clear Completed' only removes completed/failed/cancelled jobs and preserves pending/running/paused jobs. Previously it was cancelling active jobs before filtering, causing running jobs (like merges) to be removed from the queue.
This commit is contained in:
parent
c82676859e
commit
c4c41b5606
|
|
@ -524,9 +524,7 @@ func (q *Queue) Load(path string) error {
|
|||
func (q *Queue) Clear() {
|
||||
q.mu.Lock()
|
||||
|
||||
// Cancel any running jobs before filtering
|
||||
q.cancelRunningLocked()
|
||||
|
||||
// Keep only pending, running, and paused jobs
|
||||
filtered := make([]*Job, 0)
|
||||
for _, job := range q.jobs {
|
||||
if job.Status == JobStatusPending || job.Status == JobStatusRunning || job.Status == JobStatusPaused {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user