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 2021/11/18 03:08:47 UTC

[GitHub] [dubbo-go] justxuewei commented on a change in pull request #1589: refactor listenDirEvent

justxuewei commented on a change in pull request #1589:
URL: https://github.com/apache/dubbo-go/pull/1589#discussion_r751872634



##########
File path: registry/zookeeper/registry.go
##########
@@ -150,7 +150,11 @@ func (r *zkRegistry) InitListeners() {
 
 // CreatePath creates the path in the registry center of zookeeper
 func (r *zkRegistry) CreatePath(path string) error {
-	return r.ZkClient().Create(path)
+	err := r.ZkClient().Create(path)
+	if err != nil && err != zk.ErrNodeExists {

Review comment:
       IMO, using errors.Is() is better than `!=`.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

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