Skip to content

Commit

Permalink
refine redo subscribe (#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
binbin0325 authored Jun 2, 2024
1 parent 083c02f commit 61ecaa8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions clients/naming_client/naming_grpc/connection_event_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion common/constant/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "@@"
Expand Down

0 comments on commit 61ecaa8

Please sign in to comment.