From 17a448f75c50b3858223c02870e1d5b38713b148 Mon Sep 17 00:00:00 2001 From: orgin Date: Thu, 13 Oct 2022 14:29:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=85=8D=E7=BD=AE=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E8=A7=84=E5=88=99=EF=BC=8C=E5=8F=AA=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E8=AF=BB=E5=8F=96.json=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cluster/parsecfg.go | 5 +++++ 1 file changed, 5 insertions(+) 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 {