mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Just some style corrections
This commit is contained in:
parent
98f5da3bf3
commit
588d402c63
1 changed files with 3 additions and 1 deletions
|
|
@ -89,7 +89,7 @@ func (d Downloader) download(format *Format) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := os.Stat(d.TempDir); os.IsNotExist(err) {
|
if _, err := os.Stat(d.TempDir); os.IsNotExist(err) {
|
||||||
if err := os.Mkdir(d.TempDir, 0700); err != nil {
|
if err = os.Mkdir(d.TempDir, 0700); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -267,12 +267,14 @@ func (d Downloader) downloadSegments(format *Format) ([]string, error) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if k == 2 {
|
if k == 2 {
|
||||||
|
file.Close()
|
||||||
cancel()
|
cancel()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
select {
|
select {
|
||||||
case <-d.Context.Done():
|
case <-d.Context.Done():
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
|
file.Close()
|
||||||
return
|
return
|
||||||
case <-time.After(5 * time.Duration(k) * time.Second):
|
case <-time.After(5 * time.Duration(k) * time.Second):
|
||||||
// sleep if an error occurs. very useful because sometimes the connection times out
|
// sleep if an error occurs. very useful because sometimes the connection times out
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue