zbchi commented on code in PR #3210:
URL: https://github.com/apache/dubbo-go/pull/3210#discussion_r2803631898
##########
filter/polaris/limit/limiter.go:
##########
@@ -78,27 +78,27 @@ func (pl *polarisTpsLimiter) buildQuotaRequest(url
*common.URL, invocation base.
ns := remotingpolaris.GetNamespace()
applicationMode := false
- // TODO: only for compatibility with old config, able to directly
remove after config is deleted
- for _, item := range config.GetRootConfig().Registries {
- if item.Protocol == constant.PolarisKey {
- applicationMode = item.RegistryType ==
constant.ServiceKey
+ if registries, ok := url.GetAttribute(constant.RegistriesConfigKey); ok
{
+ if registryMap :=
registries.(map[string]*global.RegistryConfig); registryMap != nil {
+ for _, item := range registryMap {
+ if item != nil && item.Protocol ==
constant.PolarisKey && item.RegistryType == constant.ServiceKey {
+ applicationMode = true
+ break
+ }
+ }
}
}
Review Comment:
RegistriesConfigKey存储map[string]*global.RegistryConfig全局所有注册中心,应该从
url.GetParam()读取当前服务的配置
--
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]