Alanxtl commented on code in PR #3210:
URL: https://github.com/apache/dubbo-go/pull/3210#discussion_r2801864193
##########
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对应的是什么数据
--
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]