From 185a7a4ce868078283c6d36de6e8e3584cb8d811 Mon Sep 17 00:00:00 2001 From: binbin0325 Date: Sun, 2 Jun 2024 15:47:38 +0800 Subject: [PATCH] refine redo subscribe --- .../naming_grpc/connection_event_listener.go | 13 ++++++------- common/constant/const.go | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/clients/naming_client/naming_grpc/connection_event_listener.go b/clients/naming_client/naming_grpc/connection_event_listener.go index c4f9937e..2073a66b 100644 --- a/clients/naming_client/naming_grpc/connection_event_listener.go +++ b/clients/naming_client/naming_grpc/connection_event_listener.go @@ -52,6 +52,11 @@ func (c *ConnectionEventListener) OnDisConnect() { } func (c *ConnectionEventListener) redoSubscribe() { + grpcProxy, ok := c.clientProxy.(*NamingGrpcProxy) + if !ok { + logger.Error("redo subscribe clientProxy type error") + return + } for _, key := range c.subscribes.Keys() { info := strings.Split(key, constant.SERVICE_INFO_SPLITER) var err error @@ -61,15 +66,9 @@ func (c *ConnectionEventListener) redoSubscribe() { } else { service, err = c.clientProxy.Subscribe(info[1], info[0], "") } - if err != nil { logger.Warnf("redo subscribe service:%s faild:%+v", info[1], err) - return - } - - grpcProxy, ok := c.clientProxy.(*NamingGrpcProxy) - if !ok { - return + continue } grpcProxy.serviceInfoHolder.ProcessService(&service) } diff --git a/common/constant/const.go b/common/constant/const.go index 73c8fd5d..cc9375b0 100644 --- a/common/constant/const.go +++ b/common/constant/const.go @@ -76,7 +76,7 @@ const ( KEY_BEAT = "beat" KEY_DOM = "dom" DEFAULT_CONTEXT_PATH = "/nacos" - CLIENT_VERSION = "Nacos-Go-Client:v2.2.4" + CLIENT_VERSION = "Nacos-Go-Client:v2.2.6" REQUEST_DOMAIN_RETRY_TIME = 3 SERVICE_INFO_SPLITER = "@@" CONFIG_INFO_SPLITER = "@@"