feat(task): add speed monitor (#7655)

This commit is contained in:
KirCute_ECT
2024-12-25 21:09:54 +08:00
committed by GitHub
parent db99224126
commit d7aa1608ac
18 changed files with 116 additions and 44 deletions

View File

@ -83,6 +83,7 @@ func (s SimpleHttp) Run(task *tool.DownloadTask) error {
}
defer file.Close()
fileSize := resp.ContentLength
task.SetTotalBytes(fileSize)
err = utils.CopyWithCtx(task.Ctx(), file, resp.Body, fileSize, task.SetProgress)
return err
}