From c93852fe16067d46122538d0538ac8b40de432bb Mon Sep 17 00:00:00 2001 From: sentriz Date: Mon, 25 Sep 2023 18:47:43 +0100 Subject: [PATCH] don't pass nil clean up funcs to run.Group --- cmd/gonic/gonic.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cmd/gonic/gonic.go b/cmd/gonic/gonic.go index 6ee3e395..05c4162b 100644 --- a/cmd/gonic/gonic.go +++ b/cmd/gonic/gonic.go @@ -251,6 +251,8 @@ func main() { })) } + noCleanup := func(_ error) {} + var g run.Group g.Add(func() error { log.Print("starting job 'http'\n") @@ -266,7 +268,7 @@ func main() { return server.ListenAndServeTLS(*confTLSCert, *confTLSKey) } return server.ListenAndServe() - }, nil) + }, noCleanup) g.Add(func() error { log.Printf("starting job 'session clean'\n") @@ -275,7 +277,7 @@ func main() { sessDB.Cleanup() } return nil - }, nil) + }, noCleanup) g.Add(func() error { log.Printf("starting job 'podcast refresher'\n") @@ -286,7 +288,7 @@ func main() { } } return nil - }, nil) + }, noCleanup) g.Add(func() error { log.Printf("starting job 'podcast purger'\n") @@ -297,7 +299,7 @@ func main() { } } return nil - }, nil) + }, noCleanup) if *confScanIntervalMins > 0 { g.Add(func() error { @@ -309,7 +311,7 @@ func main() { } } return nil - }, nil) + }, noCleanup) } if *confScanWatcher { @@ -352,7 +354,7 @@ func main() { g.Add(func() error { log.Printf("starting job 'refresh artist info'\n") return artistInfoCache.Refresh(lastfmAPIKey, 8*time.Second) - }, nil) + }, noCleanup) } if *confScanAtStart {