server: fix race in noop server
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
f93ba9d977
commit
74db004f51
@ -277,7 +277,7 @@ func (n *noopServer) Deregister() error {
|
|||||||
|
|
||||||
wg := sync.WaitGroup{}
|
wg := sync.WaitGroup{}
|
||||||
for sb, subs := range n.subscribers {
|
for sb, subs := range n.subscribers {
|
||||||
for _, sub := range subs {
|
for idx := range subs {
|
||||||
if sb.Options().Context != nil {
|
if sb.Options().Context != nil {
|
||||||
cx = sb.Options().Context
|
cx = sb.Options().Context
|
||||||
}
|
}
|
||||||
@ -293,7 +293,7 @@ func (n *noopServer) Deregister() error {
|
|||||||
config.Logger.Errorf(n.opts.Context, "unsubscribing from topic: %s err: %v", s.Topic(), err)
|
config.Logger.Errorf(n.opts.Context, "unsubscribing from topic: %s err: %v", s.Topic(), err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}(sub)
|
}(subs[idx])
|
||||||
}
|
}
|
||||||
n.subscribers[sb] = nil
|
n.subscribers[sb] = nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user