chore: aria2 related function

This commit is contained in:
Noah Hsu
2022-06-20 20:34:58 +08:00
parent 4db25605e7
commit 6c552a9d62
9 changed files with 120 additions and 2 deletions

View File

@ -75,6 +75,12 @@ func (tm *Manager) Remove(tid uint64) {
tm.tasks.Delete(tid)
}
// RemoveAll removes all tasks from the manager, this maybe shouldn't be used
// because the task maybe still running.
func (tm *Manager) RemoveAll() {
tm.tasks.Clear()
}
func (tm *Manager) RemoveFinished() {
tasks := tm.GetAll()
for _, task := range tasks {