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 2022/04/13 13:38:23 UTC

[GitHub] [dubbo-go-pixiu] mark4z commented on a diff in pull request #389: Bugfix nacos registry bug

mark4z commented on code in PR #389:
URL: https://github.com/apache/dubbo-go-pixiu/pull/389#discussion_r849493701


##########
pkg/adapter/dubboregistry/registry/nacos/service_listener.go:
##########
@@ -58,11 +64,76 @@ func newNacosSrvListener(url *dubboCommon.URL, client naming_client.INamingClien
 		client:          client,
 		exit:            make(chan struct{}),
 		adapterListener: adapterListener,
+		instanceMap:     map[string]nacosModel.Instance{},
 	}
 }
 
-func (z *serviceListener) Notify(e *dubboRegistry.ServiceEvent) {
-	bkConfig, methods, location, err := registry.ParseDubboString(e.Service.String())
+func (z *serviceListener) Callback(services []nacosModel.SubscribeService, err error) {
+	if err != nil {
+		logger.Errorf("nacos subscribe callback error:%s", err.Error())
+		return
+	}
+
+	addInstances := make([]nacosModel.Instance, 0, len(services))
+	delInstances := make([]nacosModel.Instance, 0, len(services))
+	updateInstances := make([]nacosModel.Instance, 0, len(services))
+	newInstanceMap := make(map[string]nacosModel.Instance, len(services))
+
+	z.cacheLock.Lock()

Review Comment:
   考虑一下channel?



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