Remove get torrents count config and use worker pool on all places
This commit is contained in:
@@ -40,7 +40,7 @@ func (t *TorrentManager) refreshTorrents(initialRun bool) {
|
||||
freshIDs.Add(instances[i].ID)
|
||||
wg.Add(1)
|
||||
idx := i
|
||||
_ = t.workerPool.Submit(func() {
|
||||
t.workerPool.Submit(func() {
|
||||
defer wg.Done()
|
||||
if t.binImmediately(instances[idx].ID) ||
|
||||
t.binOnceDoneErrorCheck(instances[idx].ID, instances[idx].Status) ||
|
||||
@@ -136,7 +136,7 @@ func (t *TorrentManager) refreshTorrents(initialRun bool) {
|
||||
|
||||
// StartRefreshJob periodically refreshes the torrents
|
||||
func (t *TorrentManager) StartRefreshJob() {
|
||||
go func() {
|
||||
t.workerPool.Submit(func() {
|
||||
t.log.Debug("Starting periodic refresh job")
|
||||
refreshTicker := time.NewTicker(time.Duration(t.Config.GetRefreshEverySecs()) * time.Second)
|
||||
defer refreshTicker.Stop()
|
||||
@@ -157,7 +157,7 @@ func (t *TorrentManager) StartRefreshJob() {
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
func (t *TorrentManager) getMoreInfo(rdTorrent realdebrid.Torrent) *realdebrid.TorrentInfo {
|
||||
|
||||
Reference in New Issue
Block a user