Remove get torrents count config and use worker pool on all places
This commit is contained in:
@@ -355,7 +355,7 @@ func (t *TorrentManager) mountNewDownloads() {
|
||||
}
|
||||
|
||||
func (t *TorrentManager) StartDownloadsJob() {
|
||||
_ = t.workerPool.Submit(func() {
|
||||
t.workerPool.Submit(func() {
|
||||
remountTicker := time.NewTicker(time.Duration(t.Config.GetDownloadsEveryMins()) * time.Minute)
|
||||
defer remountTicker.Stop()
|
||||
|
||||
@@ -414,7 +414,7 @@ func copyFile(sourcePath, destPath string) error {
|
||||
}
|
||||
|
||||
func (t *TorrentManager) StartDumpJob() {
|
||||
_ = t.workerPool.Submit(func() {
|
||||
t.workerPool.Submit(func() {
|
||||
dumpTicker := time.NewTicker(time.Duration(t.Config.GetDumpTorrentsEveryMins()) * time.Minute)
|
||||
defer dumpTicker.Stop()
|
||||
|
||||
@@ -444,7 +444,7 @@ func (t *TorrentManager) analyzeAllTorrents() {
|
||||
}
|
||||
|
||||
func (t *TorrentManager) StartMediaAnalysisJob() {
|
||||
_ = t.workerPool.Submit(func() {
|
||||
t.workerPool.Submit(func() {
|
||||
for range t.AnalyzeTrigger {
|
||||
t.analyzeAllTorrents()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user