continue on unsubscribe/deregister

This commit is contained in:
Asim 2016-11-21 16:51:30 +01:00
parent 8873e6ad08
commit 19be4ea2fd

View File

@ -183,8 +183,10 @@ func (h *httpBroker) run(l net.Listener) {
h.Lock() h.Lock()
var subscribers []*httpSubscriber var subscribers []*httpSubscriber
for _, sub := range h.subscribers[subscriber.topic] { for _, sub := range h.subscribers[subscriber.topic] {
// deregister and skip forward
if sub.id == subscriber.id { if sub.id == subscriber.id {
h.r.Deregister(sub.svc) h.r.Deregister(sub.svc)
continue
} }
subscribers = append(subscribers, sub) subscribers = append(subscribers, sub)
} }