mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-03 15:00:27 +08:00
优化TOA相关代码
This commit is contained in:
@@ -647,10 +647,10 @@ func (this *NodeClusterDAO) FindClusterTOAConfig(tx *dbs.Tx, clusterId int64, ca
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if !IsNotNull([]byte(toa)) {
|
if !IsNotNull([]byte(toa)) {
|
||||||
return nodeconfigs.DefaultTOAConfig(), nil
|
return nodeconfigs.NewTOAConfig(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
config := &nodeconfigs.TOAConfig{}
|
var config = nodeconfigs.NewTOAConfig()
|
||||||
err = json.Unmarshal([]byte(toa), config)
|
err = json.Unmarshal([]byte(toa), config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@@ -1102,7 +1102,7 @@ func (this *NodeClusterService) FindEnabledNodeClusterConfigInfo(ctx context.Con
|
|||||||
|
|
||||||
// toa
|
// toa
|
||||||
if models.IsNotNull(cluster.Toa) {
|
if models.IsNotNull(cluster.Toa) {
|
||||||
var toaConfig = &nodeconfigs.TOAConfig{}
|
var toaConfig = nodeconfigs.NewTOAConfig()
|
||||||
err = json.Unmarshal(cluster.Toa, toaConfig)
|
err = json.Unmarshal(cluster.Toa, toaConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user