chore(aria2): export task manager

This commit is contained in:
Noah Hsu
2022-06-23 21:24:23 +08:00
parent 92983aa185
commit 40b7ecc845
5 changed files with 17 additions and 10 deletions

View File

@ -54,7 +54,7 @@ func TestDown(t *testing.T) {
if err != nil {
t.Errorf("failed to add uri: %+v", err)
}
tasks := downTaskManager.GetAll()
tasks := DownTaskManager.GetAll()
if len(tasks) != 1 {
t.Errorf("failed to get tasks: %+v", tasks)
}
@ -70,10 +70,10 @@ func TestDown(t *testing.T) {
time.Sleep(time.Second)
}
for {
if len(transferTaskManager.GetAll()) == 0 {
if len(TransferTaskManager.GetAll()) == 0 {
continue
}
tsk := transferTaskManager.GetAll()[0]
tsk := TransferTaskManager.GetAll()[0]
t.Logf("task: %+v", tsk)
if tsk.GetState() == task.Succeeded {
break