diff --git a/cluster/parsecfg.go b/cluster/parsecfg.go index 9a0b54d..d16a093 100644 --- a/cluster/parsecfg.go +++ b/cluster/parsecfg.go @@ -6,6 +6,7 @@ import ( "github.com/duanhf2012/origin/rpc" jsoniter "github.com/json-iterator/go" "os" + "path/filepath" "strings" ) @@ -126,6 +127,10 @@ func (cls *Cluster) readLocalService(localNodeId int) error { continue } + if filepath.Ext(f.Name())!= ".json" { + continue + } + filePath := strings.TrimRight(strings.TrimRight(clusterCfgPath, "/"), "\\") + "/" + f.Name() currGlobalCfg, serviceConfig, mapNodeService, err := cls.readServiceConfig(filePath) if err != nil {