Fix panic updating metrics when not enabled
This commit is contained in:
parent
1a4f4c769c
commit
7d7e34e753
|
@ -600,7 +600,9 @@ func (mb *MessageBus) Subscribe(id, topic string, opts ...SubscribeOption) chan
|
||||||
case ch <- msg:
|
case ch <- msg:
|
||||||
n++
|
n++
|
||||||
default:
|
default:
|
||||||
mb.metrics.Counter("bus", "dropped").Inc()
|
if mb.metrics != nil {
|
||||||
|
mb.metrics.Counter("bus", "dropped").Inc()
|
||||||
|
}
|
||||||
return ErrBufferFull
|
return ErrBufferFull
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue