mirror of
https://github.com/go-micro/go-micro.git
synced 2025-11-23 21:44:41 +02:00
various fixes (#1267)
* logger: remove Panic log level Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * server/grpc: add missing Unlock in Subscribe error Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * server: minor code change Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * server/grpc: extend test suite with pub/sub testing Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * server/grpc: fix invalid check and allow subscriber error to be returned Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * server/grpc: add pubsub tests Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * client/grpc: check for nil req/rsp Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -505,7 +505,6 @@ func (router *router) Subscribe(s Subscriber) error {
|
||||
}
|
||||
|
||||
func (router *router) ProcessMessage(ctx context.Context, msg Message) (err error) {
|
||||
|
||||
defer func() {
|
||||
// recover any panics
|
||||
if r := recover(); r != nil {
|
||||
@@ -516,16 +515,13 @@ func (router *router) ProcessMessage(ctx context.Context, msg Message) (err erro
|
||||
}()
|
||||
|
||||
router.su.RLock()
|
||||
|
||||
// get the subscribers by topic
|
||||
subs, ok := router.subscribers[msg.Topic()]
|
||||
if !ok {
|
||||
router.su.RUnlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
// unlock since we only need to get the subs
|
||||
router.su.RUnlock()
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errResults []string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user