Refactor workers
This commit is contained in:
@@ -16,15 +16,18 @@ const (
|
||||
EXPIRED_LINK_TOLERANCE_HOURS = 24
|
||||
)
|
||||
|
||||
func (t *TorrentManager) RepairAll() {
|
||||
func (t *TorrentManager) startRepairJob() {
|
||||
if !t.Config.EnableRepair() {
|
||||
t.log.Info("Repair is disabled, skipping repair job")
|
||||
}
|
||||
// there is 1 repair worker, with max 1 blocking task
|
||||
_ = t.repairPool.Submit(func() {
|
||||
t.log.Info("Periodic repair invoked; searching for broken torrents")
|
||||
t.repairAll()
|
||||
})
|
||||
}
|
||||
|
||||
func (t *TorrentManager) repairAll() {
|
||||
t.log.Info("Periodic repair invoked; searching for broken torrents")
|
||||
allTorrents, _ := t.DirectoryMap.Get(INT_ALL)
|
||||
|
||||
// collect all torrents that need to be repaired
|
||||
|
||||
Reference in New Issue
Block a user