diff options
Diffstat (limited to 'service/metrics/service.go')
-rw-r--r-- | service/metrics/service.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/service/metrics/service.go b/service/metrics/service.go index 4916b3e0..9e2a1a71 100644 --- a/service/metrics/service.go +++ b/service/metrics/service.go @@ -2,6 +2,7 @@ package metrics import ( "context" + "fmt" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/spiral/roadrunner/service/rpc" @@ -86,7 +87,14 @@ func (s *Service) Stop() { if s.http != nil { // gracefully stop server - go s.http.Shutdown(context.Background()) + go func() { + err := s.http.Shutdown(context.Background()) + if err != nil { + // TODO how to show error message? + // Function should be Stop() error + fmt.Println(fmt.Errorf("error shutting down the server: error %v", err)) + } + }() } } |