Fix retries on req body reads

This commit is contained in:
Ben Sarmiento
2024-02-17 06:34:36 +01:00
parent b87d99b1e6
commit 46e07f71c4
4 changed files with 27 additions and 18 deletions

View File

@@ -66,13 +66,13 @@ func (t *TorrentManager) processFixers(instances []realdebrid.Torrent) {
}
otherId := strings.TrimPrefix(command, "repaired_with:")
for _, instance := range instances {
if instance.ID == otherId {
if instance.Progress != 100 {
for _, instance2 := range instances {
if instance2.ID == otherId {
if instance2.Progress != 100 {
t.fixers.Set(id, command) // requeue the fixer
break
}
torrent := t.getMoreInfo(instance)
torrent := t.getMoreInfo(instance2)
t.log.Debugf("Repairing torrent %s again now that fixers ids=%s and %s are done", t.GetKey(torrent), id, otherId)
repairMe, _ := allTorrents.Get(t.GetKey(torrent))
toRedownload = append(toRedownload, repairMe)