refactor(task): remove Data field

This commit is contained in:
Noah Hsu
2022-06-22 19:28:41 +08:00
parent a6df492fff
commit 3fe0a7bf6b
8 changed files with 55 additions and 57 deletions

View File

@ -45,10 +45,10 @@ func AddURI(ctx context.Context, uri string, dstDirPath string) error {
return errors.Wrapf(err, "failed to add uri %s", uri)
}
// TODO add to task manager
TaskManager.Submit(task.WithCancelCtx(&task.Task[string, interface{}]{
TaskManager.Submit(task.WithCancelCtx(&task.Task[string]{
ID: gid,
Name: fmt.Sprintf("download %s to [%s](%s)", uri, account.GetAccount().VirtualPath, dstDirActualPath),
Func: func(tsk *task.Task[string, interface{}]) error {
Func: func(tsk *task.Task[string]) error {
m := &Monitor{
tsk: tsk,
tempDir: tempDir,