mirror of
https://github.com/AlistGo/alist.git
synced 2025-11-25 03:15:10 +08:00
chore: cancel task while wait for worker
This commit is contained in:
@@ -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{}{}
|
||||
|
||||
Reference in New Issue
Block a user