Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
bug fix dfget client timeout set error when fileLength is 0
Browse files Browse the repository at this point in the history
Signed-off-by: wangweiweir <wangweiweir@didichuxing.com>
  • Loading branch information
wangweiweir committed Oct 28, 2019
1 parent 5dd6fbb commit a595663
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dfget/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func downloadFile(cfg *config.Config, supernodeAPI api.SupernodeAPI,

timeout := netutils.CalculateTimeout(cfg.RV.FileLength, cfg.MinRate, config.DefaultMinRate, 10*time.Second)
if timeout == 0 && cfg.Timeout > 0 {
timeout = time.Duration(cfg.Timeout) * time.Second
timeout = cfg.Timeout
}
success := true
err := downloader.DoDownloadTimeout(getter, timeout)
Expand Down

0 comments on commit a595663

Please sign in to comment.