Repair adjustments
This commit is contained in:
@@ -262,6 +262,7 @@ func (t *TorrentManager) repair(torrent *Torrent) {
|
||||
}
|
||||
|
||||
func (t *TorrentManager) assignUnassignedLinks(torrent *Torrent) bool {
|
||||
t.log.Infof("Trying to assign links to incomplete torrent %s", t.GetKey(torrent))
|
||||
// handle torrents with incomplete links for selected files
|
||||
assignedCount := 0
|
||||
rarCount := 0
|
||||
|
||||
@@ -319,14 +319,14 @@ func backoffFunc(attempt int) time.Duration {
|
||||
}
|
||||
|
||||
func (r *HTTPClient) CanFetchFirstByte(url string) bool {
|
||||
timeout := time.Duration(r.timeoutSecs) * time.Second
|
||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||
defer cancel()
|
||||
req, err := http.NewRequest("GET", url, nil)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
req.Header.Set("Range", "bytes=0-0")
|
||||
timeout := time.Duration(r.timeoutSecs) * time.Second
|
||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||
defer cancel()
|
||||
req = req.WithContext(ctx)
|
||||
|
||||
resp, err := r.Do(req)
|
||||
|
||||
Reference in New Issue
Block a user