Small refactors
This commit is contained in:
@@ -46,19 +46,6 @@ func (t *TorrentManager) StartRepairJob() {
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// repair worker
|
||||
t.workerPool.Submit(func() {
|
||||
for {
|
||||
select {
|
||||
case torrent := <-t.repairChan:
|
||||
t.invokeRepair(torrent)
|
||||
case <-t.RepairWorkerKillSwitch:
|
||||
t.repairLog.Info("Stopping periodic repair job")
|
||||
return
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// EnqueueForRepair allows an on-demand repair to be initiated.
|
||||
@@ -447,7 +434,7 @@ func (t *TorrentManager) assignLinks(torrent *Torrent) bool {
|
||||
} else {
|
||||
t.repairLog.Warnf("Torrent %s is rar'ed and we cannot repair it, moving to unplayable directory", t.GetKey(torrent))
|
||||
t.markAsUnfixable(torrent, "rar'ed by RD")
|
||||
t.markAsUnplayable(torrent, "rar'ed by RD")
|
||||
t.markAsUnplayable(torrent)
|
||||
torrent.State.Event(context.Background(), "mark_as_repaired")
|
||||
}
|
||||
|
||||
@@ -603,7 +590,7 @@ func (t *TorrentManager) canCapacityHandle() bool {
|
||||
}
|
||||
}
|
||||
|
||||
func (t *TorrentManager) markAsUnplayable(torrent *Torrent, reason string) {
|
||||
func (t *TorrentManager) markAsUnplayable(torrent *Torrent) {
|
||||
// reassign to unplayable torrents directory
|
||||
t.DirectoryMap.IterCb(func(directory string, torrents cmap.ConcurrentMap[string, *Torrent]) {
|
||||
if strings.HasPrefix(directory, "int__") {
|
||||
|
||||
Reference in New Issue
Block a user