fix broker disconnect

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-05-13 10:59:29 +03:00
parent 254b01f75a
commit 88ef21ba9e

View File

@ -556,8 +556,6 @@ func (h *httpServer) Start() error {
} }
} }
ch <- ts.Close()
// deregister // deregister
if err := h.Deregister(); err != nil { if err := h.Deregister(); err != nil {
config.Logger.Errorf(config.Context, "Server deregister error: %s", err) config.Logger.Errorf(config.Context, "Server deregister error: %s", err)
@ -566,6 +564,9 @@ func (h *httpServer) Start() error {
if err := config.Broker.Disconnect(config.Context); err != nil { if err := config.Broker.Disconnect(config.Context); err != nil {
config.Logger.Errorf(config.Context, "Broker disconnect error: %s", err) config.Logger.Errorf(config.Context, "Broker disconnect error: %s", err)
} }
ch <- ts.Close()
}() }()
return nil return nil