Test: tasks pkg

This commit is contained in:
HFO4
2021-11-20 17:14:45 +08:00
parent 9056ef9171
commit 96b84bb5e5
7 changed files with 44 additions and 12 deletions

View File

@@ -82,7 +82,7 @@ func Record(job Job) (*model.Task, error) {
}
// Resume 从数据库中恢复未完成任务
func Resume() {
func Resume(p Pool) {
tasks := model.GetTasksByStatus(Queued, Processing)
if len(tasks) == 0 {
return
@@ -97,7 +97,7 @@ func Resume() {
}
if job != nil {
TaskPoll.Submit(job)
p.Submit(job)
}
}
}