feat: task manage api
This commit is contained in:
@ -60,7 +60,7 @@ func TestDown(t *testing.T) {
|
||||
for {
|
||||
tsk := tasks[0]
|
||||
t.Logf("task: %+v", tsk)
|
||||
if tsk.GetState() == task.Succeeded {
|
||||
if tsk.GetState() == task.SUCCEEDED {
|
||||
break
|
||||
}
|
||||
if tsk.GetState() == task.ERRORED {
|
||||
@ -74,7 +74,7 @@ func TestDown(t *testing.T) {
|
||||
}
|
||||
tsk := TransferTaskManager.GetAll()[0]
|
||||
t.Logf("task: %+v", tsk)
|
||||
if tsk.GetState() == task.Succeeded {
|
||||
if tsk.GetState() == task.SUCCEEDED {
|
||||
break
|
||||
}
|
||||
if tsk.GetState() == task.ERRORED {
|
||||
|
@ -1,14 +0,0 @@
|
||||
package aria2
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/alist-org/alist/v3/pkg/task"
|
||||
)
|
||||
|
||||
func ListFinished(ctx context.Context) []*task.Task[string] {
|
||||
return DownTaskManager.GetByStates(task.Succeeded, task.CANCELED, task.ERRORED)
|
||||
}
|
||||
|
||||
func ListUndone(ctx context.Context) []*task.Task[string] {
|
||||
return DownTaskManager.GetByStates(task.PENDING, task.RUNNING, task.CANCELING)
|
||||
}
|
Reference in New Issue
Block a user