little-cui commented on code in PR #1468: URL: https://github.com/apache/servicecomb-service-center/pull/1468#discussion_r1563612776
########## syncer/config/config.go: ########## @@ -68,6 +69,20 @@ func Reload() error { return nil } +func ReloadConfig() { Review Comment: 补充UT ########## syncer/config/config.go: ########## @@ -68,6 +69,20 @@ func Reload() error { return nil } +func ReloadConfig() { + peersFile := archaius.Get("sync.peers").([]interface{}) + config.Sync.Peers = []*Peer{} + for _, va := range peersFile { + val := va.(map[string]interface{}) + peer := &Peer{} + peer.Name = val["name"].(string) + peer.Kind = val["kind"].(string) + peer.Endpoints = val["endpoints"].([]string) + peer.Mode = val["mode"].([]string) + config.Sync.Peers = append(config.Sync.Peers, peer) Review Comment: 如果发生变化,打印WARN日志 -- 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: commits-unsubscr...@servicecomb.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org