Skip to content

Commit

Permalink
Log http serve error
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Sep 16, 2022
1 parent 72c6a2a commit 1a63aa4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,12 @@ func initMetrics() error {
}
http.Handle("/", promhttp.Handler())
log.Print("Serving metrics at :2222/")
go http.ListenAndServe(":2222", nil)
go func() {
err := http.ListenAndServe(":2222", nil)
if err != nil {
log.Print(err)
}
}()

ctx, _ := signal.NotifyContext(context.Background(), os.Interrupt)
wg.Add(1)
Expand Down

0 comments on commit 1a63aa4

Please sign in to comment.