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.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/service/http/service.go b/service/http/service.go
index d98a4596..2df8656c 100644
--- a/service/http/service.go
+++ b/service/http/service.go
@@ -97,15 +97,15 @@ func (s *Service) Serve() error {
// Stop stops the svc.
func (s *Service) Stop() {
- atomic.AddInt32(&s.inStopping, 1)
- defer atomic.AddInt32(&s.inStopping, -1)
-
s.mu.Lock()
defer s.mu.Unlock()
- if s.http == nil || s.stopping() {
+ if s.http == nil {
return
}
+ atomic.AddInt32(&s.inStopping, 1)
+ defer atomic.AddInt32(&s.inStopping, -1)
+
s.http.Shutdown(context.Background())
}