summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-23 20:39:13 +0300
committerWolfy-J <[email protected]>2018-06-23 20:39:13 +0300
commit18201f5f6af71fad14bbfc93eec1654b2f8fa585 (patch)
tree36cfe76e67998f414d7efb00f1a7c030bbfbcfad /service
parenta47fdb8b8c93a8e2c9af1d786e746b145f4b16ed (diff)
custom version
Diffstat (limited to 'service')
-rw-r--r--service/http/service.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/service/http/service.go b/service/http/service.go
index f171e48e..cef019b3 100644
--- a/service/http/service.go
+++ b/service/http/service.go
@@ -97,6 +97,11 @@ func (s *Service) Serve() error {
// Stop stops the svc.
func (s *Service) Stop() {
+ if atomic.LoadInt32(&s.stopping) != 0 {
+ // already stopping
+ return
+ }
+
s.mu.Lock()
defer s.mu.Unlock()
if s.http == nil {