fix: Deregister subscribers
This commit is contained in:
parent
7968395d51
commit
3f5cbf2bcd
15
http.go
15
http.go
@ -189,7 +189,20 @@ func (h *httpServer) Deregister() error {
|
|||||||
log.Logf("Deregistering node: %s", opts.Name+"-"+opts.Id)
|
log.Logf("Deregistering node: %s", opts.Name+"-"+opts.Id)
|
||||||
|
|
||||||
service := serviceDef(opts)
|
service := serviceDef(opts)
|
||||||
return opts.Registry.Deregister(service)
|
if err := opts.Registry.Deregister(service); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
h.Lock()
|
||||||
|
for sb, subs := range h.subscribers {
|
||||||
|
for _, sub := range subs {
|
||||||
|
log.Logf("Unsubscribing from topic: %s", sub.Topic())
|
||||||
|
sub.Unsubscribe()
|
||||||
|
}
|
||||||
|
h.subscribers[sb] = nil
|
||||||
|
}
|
||||||
|
h.Unlock()
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *httpServer) Start() error {
|
func (h *httpServer) Start() error {
|
||||||
|
Loading…
Reference in New Issue
Block a user