Alanxtl commented on code in PR #3682:
URL: https://github.com/apache/dubbo-go/pull/3682#discussion_r3810421636
##########
cluster/router/script/router.go:
##########
@@ -117,11 +123,11 @@ func (s *ScriptRouter) Process(event
*config_center.ConfigChangeEvent) {
logger.Error("[Router][Script] applicationName field
must be set in config")
return
}
- if !*cfg.Enabled {
+ if cfg.Enabled != nil && !*cfg.Enabled {
Review Comment:
这个分支加个else 处理一下
##########
cluster/router/script/router.go:
##########
@@ -117,11 +123,11 @@ func (s *ScriptRouter) Process(event
*config_center.ConfigChangeEvent) {
logger.Error("[Router][Script] applicationName field
must be set in config")
return
}
- if !*cfg.Enabled {
+ if cfg.Enabled != nil && !*cfg.Enabled {
logger.Infof("[Router][Script] enabled field equals
false, this rule will be ignored, script=%s", cfg.Script)
}
// rewrite to ScriptRouter
- s.enabled = *cfg.Enabled
+ s.enabled = cfg.Enabled == nil || *cfg.Enabled
Review Comment:
这里不应该是cfg.Enabled != nil && *cfg.Enabled吗
--
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]