mirror of
https://github.com/bit1001/tdl.git
synced 2024-09-20 06:35:54 +08:00
chore(downloader): optimize aborted style
This commit is contained in:
parent
db72b0b274
commit
e1e4ae4986
|
@ -64,14 +64,14 @@ func (d *Downloader) Download(ctx context.Context, limit int) error {
|
|||
|
||||
err := wg.Wait()
|
||||
if err != nil {
|
||||
if errors.Is(err, context.Canceled) {
|
||||
d.pw.Log(color.RedString("Download aborted."))
|
||||
}
|
||||
|
||||
d.pw.Stop()
|
||||
for d.pw.IsRenderInProgress() {
|
||||
time.Sleep(time.Millisecond * 10)
|
||||
}
|
||||
|
||||
if errors.Is(err, context.Canceled) {
|
||||
color.Red("Download aborted.")
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue