Skip to content

Commit

Permalink
fix review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
lzp0412 committed Jul 26, 2020
1 parent 1e7e05a commit b8893fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions registry/nacos/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func createRegisterParam(url common.URL, serviceName string) vo.RegisterInstance
return instance
}

func createDegisterParam(url common.URL, serviceName string) vo.DeregisterInstanceParam {
func createDeregisterParam(url common.URL, serviceName string) vo.DeregisterInstanceParam {
if len(url.Ip) == 0 {
url.Ip = localIP
}
Expand Down Expand Up @@ -209,13 +209,13 @@ func (nr *nacosRegistry) Register(url common.URL) error {

func (nr *nacosRegistry) DeRegister(url common.URL) error {
serviceName := getServiceName(url)
param := createDegisterParam(url, serviceName)
param := createDeregisterParam(url, serviceName)
isDeRegistry, err := nr.namingClient.DeregisterInstance(param)
if err != nil {
return err
}
if !isDeRegistry {
return perrors.New("DeRegistry [" + serviceName + "] to nacos failed")
return perrors.New("DeRegistry [" + serviceName + "] to nacos failed")
}
return nil
}
Expand Down Expand Up @@ -271,7 +271,7 @@ func (nr *nacosRegistry) Destroy() {
err := nr.DeRegister(url)
logger.Infof("DeRegister Nacos url:%+v", url)
if err != nil {
logger.Errorf("Deregister url:%+v err:%v", url, err.Error())
logger.Errorf("Deregister url:%+v err:%v", url, err.Error())
}
}
return
Expand Down

0 comments on commit b8893fc

Please sign in to comment.