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