improve coverage #118

Merged
vtolstov merged 7 commits from cover into v3 2022-04-17 16:28:59 +03:00
2 changed files with 4 additions and 3 deletions
Showing only changes of commit fb4d747197 - Show all commits

View File

@ -282,13 +282,14 @@ func (n *noopServer) Deregister() error {
cx = sb.Options().Context cx = sb.Options().Context
} }
ncx := cx
wg.Add(1) wg.Add(1)
go func(s broker.Subscriber) { go func(s broker.Subscriber) {
defer wg.Done() defer wg.Done()
if config.Logger.V(logger.InfoLevel) { if config.Logger.V(logger.InfoLevel) {
config.Logger.Infof(n.opts.Context, "unsubscribing from topic: %s", s.Topic()) config.Logger.Infof(n.opts.Context, "unsubscribing from topic: %s", s.Topic())
} }
if err := s.Unsubscribe(cx); err != nil { if err := s.Unsubscribe(ncx); err != nil {
if config.Logger.V(logger.ErrorLevel) { if config.Logger.V(logger.ErrorLevel) {
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)
} }

View File

@ -11,7 +11,7 @@ import (
) )
// DefaultServer default server // DefaultServer default server
var DefaultServer Server = NewServer() var DefaultServer = NewServer()
var ( var (
// DefaultAddress will be used if no address passed, use secure localhost // DefaultAddress will be used if no address passed, use secure localhost