From 59ea55d337ea3061ef9d18120395214ed81511d4 Mon Sep 17 00:00:00 2001 From: Contextualist Date: Tue, 14 Jun 2022 21:52:13 -0400 Subject: [PATCH] Fix closing feed updates channel too early --- cmd/podsync/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/podsync/main.go b/cmd/podsync/main.go index 333d5a6..acb2e76 100644 --- a/cmd/podsync/main.go +++ b/cmd/podsync/main.go @@ -155,6 +155,10 @@ func main() { return } + // Queue of feeds to update + updates := make(chan *feed.Config, 16) + defer close(updates) + group, ctx := errgroup.WithContext(ctx) defer func() { if err := group.Wait(); err != nil && (err != context.Canceled && err != http.ErrServerClosed) { @@ -163,10 +167,6 @@ func main() { log.Info("gracefully stopped") }() - // Queue of feeds to update - updates := make(chan *feed.Config, 16) - defer close(updates) - // Create Cron c := cron.New(cron.WithChain(cron.SkipIfStillRunning(cron.DiscardLogger))) m := make(map[string]cron.EntryID)