mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
优化配置读取规则,只允许读取.json配置
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user