summaryrefslogtreecommitdiff
path: root/service/http/service.go
diff options
context:
space:
mode:
Diffstat (limited to 'service/http/service.go')
-rw-r--r--service/http/service.go27
1 files changed, 24 insertions, 3 deletions
diff --git a/service/http/service.go b/service/http/service.go
index 58038acb..1547538b 100644
--- a/service/http/service.go
+++ b/service/http/service.go
@@ -157,15 +157,36 @@ func (s *Service) Stop() {
defer s.mu.Unlock()
if s.fcgi != nil {
- go s.fcgi.Shutdown(context.Background())
+ go func() {
+ err := s.fcgi.Shutdown(context.Background())
+ if err != nil {
+ // TODO think about returning error from this Stop function
+ // Stop() error
+ // push error from goroutines to the channel and block unil error or success shutdown or timeout
+ fmt.Println(fmt.Errorf("error shutting down the server, error: %v", err))
+ return
+ }
+ }()
}
if s.https != nil {
- go s.https.Shutdown(context.Background())
+ go func() {
+ err := s.fcgi.Shutdown(context.Background())
+ if err != nil {
+ fmt.Println(fmt.Errorf("error shutting down the server, error: %v", err))
+ return
+ }
+ }()
}
if s.http != nil {
- go s.http.Shutdown(context.Background())
+ go func() {
+ err := s.fcgi.Shutdown(context.Background())
+ if err != nil {
+ fmt.Println(fmt.Errorf("error shutting down the server, error: %v", err))
+ return
+ }
+ }()
}
}