mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 05:34:05 -08:00
simplify server error handling (#4006)
This commit is contained in:
parent
60dafd425c
commit
5fec98d0a7
17
web/web.go
17
web/web.go
|
@ -484,18 +484,13 @@ func (h *Handler) Run(ctx context.Context) error {
|
|||
ReadTimeout: h.options.ReadTimeout,
|
||||
}
|
||||
|
||||
go func() {
|
||||
if err := httpSrv.Serve(httpl); err != nil {
|
||||
level.Warn(h.logger).Log("msg", "error serving HTTP", "err", err)
|
||||
}
|
||||
}()
|
||||
go func() {
|
||||
if err := grpcSrv.Serve(grpcl); err != nil {
|
||||
level.Warn(h.logger).Log("msg", "error serving gRPC", "err", err)
|
||||
}
|
||||
}()
|
||||
|
||||
errCh := make(chan error)
|
||||
go func() {
|
||||
errCh <- httpSrv.Serve(httpl)
|
||||
}()
|
||||
go func() {
|
||||
errCh <- grpcSrv.Serve(grpcl)
|
||||
}()
|
||||
go func() {
|
||||
errCh <- m.Serve()
|
||||
}()
|
||||
|
|
Loading…
Reference in a new issue