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 2021/12/06 08:15:59 UTC
[GitHub] [dubbo-go] zhaoyunxing92 commented on a change in pull request #1592: Config update issue
zhaoyunxing92 commented on a change in pull request #1592:
URL: https://github.com/apache/dubbo-go/pull/1592#discussion_r762780516
##########
File path: config/root_config.go
##########
@@ -358,3 +360,25 @@ func publishMapping(sc exporter.MetadataServiceExporter) error {
}
return nil
}
+
+// Process receive changing listener's event, dynamic update config
+func (rc *RootConfig) Process(event *config_center.ConfigChangeEvent) {
+ logger.Infof("CenterConfig process event:\n%+v", event)
+ koan := koanf.New(".")
+ if err := koan.Load(rawbytes.Provider([]byte(event.Value.(string))), yaml.Parser()); err != nil {
Review comment:
这段代码可以考虑下面代码替换
```go
config := NewLoaderConf(WithDelim("."), WithGenre(cc.FileExtension), WithBytes([]byte(strConf)))
koan := GetConfigResolver(config)
```
--
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