diff --git a/app/app.go b/app/app.go index 3244e51..9dd39e8 100644 --- a/app/app.go +++ b/app/app.go @@ -38,7 +38,8 @@ func Run(configPath string) { tgram := telegram.NewTelegramSender(tgramProxy, cfg.TelegramAuthToken) wg := sync.WaitGroup{} - for _, feed := range cfg.Feeds { + for i := range cfg.Feeds { + feed := &cfg.Feeds[i] log.Info("processing feed", "feed", feed.Name) wg.Add(1) go func() { @@ -49,7 +50,7 @@ func Run(configPath string) { wg.Wait() } -func ProcessFeed(feed FeedCfg, scheduler Scheduler, dbDir string, tgram telegram.TelegramSender) { +func ProcessFeed(feed *FeedCfg, scheduler Scheduler, dbDir string, tgram telegram.TelegramSender) { sd, err := scheduler.ShouldDownload(feed.Name, feed.Cron) if err != nil { log.Error("shouldDownload failed", "feed", feed.Name, "err", err)