mirror of
https://github.com/go-gitea/gitea
synced 2025-02-09 06:57:04 +01:00
Cancel pool workers when removed
This commit is contained in:
parent
6306cd42bc
commit
8798a61ba4
@ -181,8 +181,12 @@ func (q *ManagedQueue) CancelWorkers(pid int64) {
|
||||
// RemoveWorkers deletes pooled workers with pid
|
||||
func (q *ManagedQueue) RemoveWorkers(pid int64) {
|
||||
q.mutex.Lock()
|
||||
pw, ok := q.PoolWorkers[pid]
|
||||
delete(q.PoolWorkers, pid)
|
||||
q.mutex.Unlock()
|
||||
if ok && pw.Cancel != nil {
|
||||
pw.Cancel()
|
||||
}
|
||||
}
|
||||
|
||||
// AddWorkers adds workers to the queue if it has registered an add worker function
|
||||
|
Loading…
x
Reference in New Issue
Block a user