Reunify workers, add commands
This commit is contained in:
@@ -30,17 +30,20 @@ func (t *TorrentManager) handleFixers() {
|
||||
}
|
||||
command, _ := t.fixers.Pop(id)
|
||||
switch command {
|
||||
case "delete":
|
||||
case "delete_replaced":
|
||||
t.log.Debugf("Deleting old id=%s because it's redundant to fixed %s ", id, t.GetKey(torrent))
|
||||
toDelete = append(toDelete, id)
|
||||
case "delete_failed":
|
||||
t.log.Debugf("Deleting failed fixer id=%s of torrent %s", id, t.GetKey(torrent))
|
||||
toDelete = append(toDelete, id)
|
||||
case "repair":
|
||||
t.log.Debugf("Repairing torrent %s again now that fixer id=%s is done", t.GetKey(torrent), id)
|
||||
toDelete = append(toDelete, id)
|
||||
t.log.Debugf("Repairing torrent %s again now that fixer is done", t.GetKey(torrent))
|
||||
repairMe, _ := allTorrents.Get(t.GetKey(torrent))
|
||||
t.TriggerRepair(repairMe)
|
||||
}
|
||||
})
|
||||
for _, id := range toDelete {
|
||||
t.log.Debugf("Deleting fixer torrent id=%s", id)
|
||||
t.Api.DeleteTorrent(id)
|
||||
infoCache.Remove(id)
|
||||
t.deleteTorrentFile(id)
|
||||
|
||||
Reference in New Issue
Block a user