|
|
@ -557,6 +557,8 @@ func (d *Downloader) spawnSync(fetchers []func() error) error { |
|
|
|
func (d *Downloader) cancel() { |
|
|
|
func (d *Downloader) cancel() { |
|
|
|
// Close the current cancel channel
|
|
|
|
// Close the current cancel channel
|
|
|
|
d.cancelLock.Lock() |
|
|
|
d.cancelLock.Lock() |
|
|
|
|
|
|
|
defer d.cancelLock.Unlock() |
|
|
|
|
|
|
|
|
|
|
|
if d.cancelCh != nil { |
|
|
|
if d.cancelCh != nil { |
|
|
|
select { |
|
|
|
select { |
|
|
|
case <-d.cancelCh: |
|
|
|
case <-d.cancelCh: |
|
|
@ -565,7 +567,6 @@ func (d *Downloader) cancel() { |
|
|
|
close(d.cancelCh) |
|
|
|
close(d.cancelCh) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
d.cancelLock.Unlock() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Cancel aborts all of the operations and waits for all download goroutines to
|
|
|
|
// Cancel aborts all of the operations and waits for all download goroutines to
|
|
|
|