mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
优化初始化方式
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
var configdir = "./config/"
|
||||
|
||||
type SubNet struct {
|
||||
SubNetName string
|
||||
NodeList []NodeInfo
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ func (slf *Cluster) InitCfg(currentNodeId int) error{
|
||||
if ok == false {
|
||||
return fmt.Errorf("NodeId %d not in any subnet",currentNodeId)
|
||||
}
|
||||
|
||||
subnet.SubNetName = localSubnetName
|
||||
for _,nodeinfo := range subnet.NodeList {
|
||||
localSubNetMapNode[nodeinfo.NodeId] = nodeinfo
|
||||
|
||||
@@ -160,7 +160,7 @@ func (slf *Cluster) InitCfg(currentNodeId int) error{
|
||||
slf.localNodeInfo =localNodeInfo
|
||||
|
||||
//读取服务
|
||||
|
||||
slf.ReadLocalSubNetServiceConfig(slf.localsubnet.SubNetName)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user