You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2020/12/28 08:59:05 UTC

[GitHub] [dubbo-go] LaurenceLiZhixin commented on a change in pull request #973: Fix/consul unreg

LaurenceLiZhixin commented on a change in pull request #973:
URL: https://github.com/apache/dubbo-go/pull/973#discussion_r549268672



##########
File path: registry/consul/registry.go
##########
@@ -91,6 +95,7 @@ func (r *consulRegistry) Register(url *common.URL) error {
 
 // register actually register the @url
 func (r *consulRegistry) register(url *common.URL) error {
+	r.registeredURLs = append(r.registeredURLs, url.Clone())

Review comment:
       1. 我认为在注册前把url添加进数组没有问题。
   因为最终destroy的时候,即使unregister不存在的url也无妨。
   2. 因为buildServicce会对url进行修改,而其中buildid函数是根据修改前的url生成的id,在unregister的时候,也必须严格使用修改前的url来生成id,所以这里临时把修改前的拷贝了出来,用于unregister。




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org