mirror of https://github.com/Xhofe/alist
chore: cancel task while wait for worker
parent
fd55f2cbfa
commit
e614faa99b
|
@ -32,6 +32,9 @@ func (tm *Manager[K]) do(task *Task[K]) {
|
|||
log.Debugf("task [%s] starting", task.Name)
|
||||
task.run()
|
||||
log.Debugf("task [%s] ended", task.Name)
|
||||
case <-task.Ctx.Done():
|
||||
log.Debugf("task [%s] canceled", task.Name)
|
||||
return
|
||||
}
|
||||
// return worker
|
||||
tm.workerC <- struct{}{}
|
||||
|
|
Loading…
Reference in New Issue