Skip to content

Commit 1741b71

Browse files
committed
check if monitoring config is set
1 parent 5833f71 commit 1741b71

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/downloader/monitor.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ func (c *DownloadClient) MonitorDownloads(tracks []*models.Track, m Monitor) err
4343

4444
progressMap := make(map[string]*DownloadMonitor)
4545
monCfg := m.GetConf()
46+
if monCfg.CheckInterval == 0 || monCfg.MonitorDuration == 0 {
47+
return fmt.Errorf("no monitoring config set, skipping monitoring")
48+
}
4649

4750
ticker := time.NewTicker(monCfg.CheckInterval)
4851
defer ticker.Stop()

0 commit comments

Comments
 (0)