don't start purge job if podcast-purge-age-days not set
Co-authored-by: Alex McGrath <amk@amk.ie>
This commit is contained in:
@@ -301,16 +301,18 @@ func main() {
|
|||||||
return nil
|
return nil
|
||||||
}, noCleanup)
|
}, noCleanup)
|
||||||
|
|
||||||
g.Add(func() error {
|
if *confPodcastPurgeAgeDays > 0 {
|
||||||
log.Printf("starting job 'podcast purger'\n")
|
g.Add(func() error {
|
||||||
ticker := time.NewTicker(24 * time.Hour)
|
log.Printf("starting job 'podcast purger'\n")
|
||||||
for range ticker.C {
|
ticker := time.NewTicker(24 * time.Hour)
|
||||||
if err := podcast.PurgeOldPodcasts(time.Duration(*confPodcastPurgeAgeDays) * 24 * time.Hour); err != nil {
|
for range ticker.C {
|
||||||
log.Printf("error purging old podcasts: %v", err)
|
if err := podcast.PurgeOldPodcasts(time.Duration(*confPodcastPurgeAgeDays) * 24 * time.Hour); err != nil {
|
||||||
|
log.Printf("error purging old podcasts: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
return nil
|
||||||
return nil
|
}, noCleanup)
|
||||||
}, noCleanup)
|
}
|
||||||
|
|
||||||
if *confScanIntervalMins > 0 {
|
if *confScanIntervalMins > 0 {
|
||||||
g.Add(func() error {
|
g.Add(func() error {
|
||||||
|
|||||||
Reference in New Issue
Block a user