Aias00 commented on code in PR #982:
URL: https://github.com/apache/dubbo-go-pixiu/pull/982#discussion_r3595634799
##########
pkg/adapter/springcloud/servicediscovery/nacos/nacos.go:
##########
@@ -118,7 +118,14 @@ func (n *nacosServiceDiscovery) Callback(services
[]xdsmodel.SubscribeService, e
continue
}
- instance := fromSubscribeServiceToServiceInstance(service)
+ // v2 subscribe callback receives Instance directly (was
SubscribeService in v1)
+ // ServiceName may contain group prefix like
"DEFAULT_GROUP@@service-name", strip it
+ serviceName := service.ServiceName
+ if tmp := strings.Split(serviceName, "@@"); len(tmp) == 2 {
+ serviceName = tmp[1]
+ }
+
+ instance := fromInstanceToServiceInstance(serviceName, service)
key := instance.GetUniqKey()
newInstanceMap[instance.GetUniqKey()] = instance
Review Comment:
Already addressed in commit `233d147b` — `key := instance.GetUniqKey()` is
now computed once and reused for the map write (`newInstanceMap[key] =
instance`).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]