From a7982f6e692e9dc40f035d5f1486cb2bbae71f88 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Sun, 17 Nov 2019 18:13:15 +0300 Subject: finish the check --- service/health/service.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'service/health') diff --git a/service/health/service.go b/service/health/service.go index c0be68e0..a730de7e 100644 --- a/service/health/service.go +++ b/service/health/service.go @@ -2,6 +2,7 @@ package health import ( "context" + "fmt" "net/http" "sync" @@ -47,7 +48,13 @@ func (s *Service) Stop() { if s.http != nil { // gracefully stop the server - go s.http.Shutdown(context.Background()) + go func() { + err := s.http.Shutdown(context.Background()) + if err != nil { + // TODO how to log error here? + fmt.Println(fmt.Errorf("error shutting down the server: error %v", err)) + } + }() } } -- cgit v1.2.3