Merge pull request 'check subscribe errors' (#162) from subscribeerr into v3
Reviewed-on: #162
This commit is contained in:
commit
8e09142b90
19
http.go
19
http.go
@ -378,6 +378,17 @@ func (h *Server) Register() error {
|
||||
}
|
||||
|
||||
h.Lock()
|
||||
|
||||
h.registered = true
|
||||
h.rsvc = service
|
||||
h.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (h *Server) subscribe() error {
|
||||
config := h.opts
|
||||
|
||||
for sb := range h.subscribers {
|
||||
handler := h.createSubHandler(sb, config)
|
||||
var opts []broker.SubscribeOption
|
||||
@ -401,10 +412,6 @@ func (h *Server) Register() error {
|
||||
h.subscribers[sb] = []broker.Subscriber{sub}
|
||||
}
|
||||
|
||||
h.registered = true
|
||||
h.rsvc = service
|
||||
h.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -539,6 +546,10 @@ func (h *Server) Start() error {
|
||||
}
|
||||
}
|
||||
|
||||
if err := h.subscribe(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fn := handler
|
||||
|
||||
if h.opts.Context != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user