More efficient repairs

This commit is contained in:
Ben Sarmiento
2023-12-02 05:46:27 +01:00
parent 01a0da46e8
commit bba4418b8c
2 changed files with 19 additions and 34 deletions

View File

@@ -69,7 +69,6 @@ func (gf *GetFile) HandleGetRequest(directory, torrentName, fileName string, res
// log.Warnf("File %s is no longer available, link %s", filepath.Base(file.Path), link)
file.Link = "repairing"
torMgr.Repair(torrent)
torMgr.UpdateTorrentResponseCache(torrent)
http.Error(resp, "File is not available", http.StatusNotFound)
return
} else {
@@ -151,7 +150,6 @@ func (gf *GetFile) streamFileToResponse(torrent *intTor.Torrent, file *intTor.Fi
log.Warnf("Cannot download file %s: %v", file.Path, err)
file.Link = "repairing"
torMgr.Repair(torrent)
torMgr.UpdateTorrentResponseCache(torrent)
}
http.Error(resp, "File is not available", http.StatusNotFound)
return
@@ -163,7 +161,6 @@ func (gf *GetFile) streamFileToResponse(torrent *intTor.Torrent, file *intTor.Fi
log.Warnf("Received a %s status code for file %s", download.Status, file.Path)
file.Link = "repairing"
torMgr.Repair(torrent)
torMgr.UpdateTorrentResponseCache(torrent)
}
http.Error(resp, "File is not available", http.StatusNotFound)
return