Browse Source

Cancel pool workers when removed

pull/9363/head
Andrew Thornton 6 years ago
parent
commit
8798a61ba4
No known key found for this signature in database
GPG Key ID: 3CDE74631F13A748
  1. 4
      modules/queue/manager.go

4
modules/queue/manager.go

@ -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…
Cancel
Save