summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-10-18 13:26:07 +0300
committerWolfy-J <[email protected]>2018-10-18 13:26:07 +0300
commit71bc7a5df562d671ed3d5ffc0e6f8ee8c9832d26 (patch)
tree1fd0f371c7fd2cb002d01e1d1492b8c57c76c4bb
parent5c3ba4ddd3db5dbad00fc9a61e3bcf115658b935 (diff)
- bugfix: ignored `stopping` value during http server shutdown
- debug log now split message into individual lines
-rw-r--r--service/http/service.go27
1 files changed, 9 insertions, 18 deletions
diff --git a/service/http/service.go b/service/http/service.go
index a7e8e44c..e8e8eb51 100644
--- a/service/http/service.go
+++ b/service/http/service.go
@@ -12,7 +12,6 @@ import (
"net/url"
"strings"
"sync"
- "sync/atomic"
)
const (
@@ -28,16 +27,15 @@ type middleware func(f http.HandlerFunc) http.HandlerFunc
// Service manages rr, http servers.
type Service struct {
- cfg *Config
- env env.Environment
- lsns []func(event int, ctx interface{})
- mdwr []middleware
- mu sync.Mutex
- rr *roadrunner.Server
- stopping int32
- handler *Handler
- http *http.Server
- https *http.Server
+ cfg *Config
+ env env.Environment
+ lsns []func(event int, ctx interface{})
+ mdwr []middleware
+ mu sync.Mutex
+ rr *roadrunner.Server
+ handler *Handler
+ http *http.Server
+ https *http.Server
}
// AddMiddleware adds new net/http mdwr.
@@ -109,13 +107,6 @@ func (s *Service) Serve() error {
// Stop stops the svc.
func (s *Service) Stop() {
- if atomic.LoadInt32(&s.stopping) != 0 {
- // already stopping
- return
- }
-
- atomic.StoreInt32(&s.stopping, 1)
-
s.mu.Lock()
defer s.mu.Unlock()
if s.http == nil {