Skip to content

Commit c93852f

Browse files
committed
don't pass nil clean up funcs to run.Group
1 parent 39fb8e7 commit c93852f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

cmd/gonic/gonic.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ func main() {
251251
}))
252252
}
253253

254+
noCleanup := func(_ error) {}
255+
254256
var g run.Group
255257
g.Add(func() error {
256258
log.Print("starting job 'http'\n")
@@ -266,7 +268,7 @@ func main() {
266268
return server.ListenAndServeTLS(*confTLSCert, *confTLSKey)
267269
}
268270
return server.ListenAndServe()
269-
}, nil)
271+
}, noCleanup)
270272

271273
g.Add(func() error {
272274
log.Printf("starting job 'session clean'\n")
@@ -275,7 +277,7 @@ func main() {
275277
sessDB.Cleanup()
276278
}
277279
return nil
278-
}, nil)
280+
}, noCleanup)
279281

280282
g.Add(func() error {
281283
log.Printf("starting job 'podcast refresher'\n")
@@ -286,7 +288,7 @@ func main() {
286288
}
287289
}
288290
return nil
289-
}, nil)
291+
}, noCleanup)
290292

291293
g.Add(func() error {
292294
log.Printf("starting job 'podcast purger'\n")
@@ -297,7 +299,7 @@ func main() {
297299
}
298300
}
299301
return nil
300-
}, nil)
302+
}, noCleanup)
301303

302304
if *confScanIntervalMins > 0 {
303305
g.Add(func() error {
@@ -309,7 +311,7 @@ func main() {
309311
}
310312
}
311313
return nil
312-
}, nil)
314+
}, noCleanup)
313315
}
314316

315317
if *confScanWatcher {
@@ -352,7 +354,7 @@ func main() {
352354
g.Add(func() error {
353355
log.Printf("starting job 'refresh artist info'\n")
354356
return artistInfoCache.Refresh(lastfmAPIKey, 8*time.Second)
355-
}, nil)
357+
}, noCleanup)
356358
}
357359

358360
if *confScanAtStart {

0 commit comments

Comments
 (0)