Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion dfget/core/downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ func DoDownloadTimeout(downloader Downloader, timeout time.Duration) error {

var ch = make(chan error)
go func() {
ch <- downloader.Run(ctx)
select {
case <- ctx.Done():
return
case ch <- downloader.Run(ctx):
return
}
}()
defer cancel()

Expand Down