Refactor robust retry in http client

This commit is contained in:
Ben Sarmiento
2024-01-22 19:41:29 +01:00
parent 3131e3cbdf
commit 8aa1362df2
2 changed files with 52 additions and 55 deletions

View File

@@ -164,8 +164,8 @@ func (dl *Downloader) streamFileToResponse(torrent *intTor.Torrent, file *intTor
download, err := dl.client.Do(dlReq)
if err != nil {
log.Warnf("Cannot download file %s: %v", unrestrict.Download, err)
if file != nil && unrestrict.Streamable == 1 {
log.Warnf("Cannot download file %s: %v", file.Path, err)
if cfg.EnableRepair() && torrent != nil {
torrent.BrokenLinks.Add(file.Link)
file.Link = "repair"