优化代码

This commit is contained in:
GoEdgeLab
2022-04-23 13:26:15 +08:00
parent 777732d98d
commit 14d1438ab6
2 changed files with 5 additions and 2 deletions

View File

@@ -56,7 +56,7 @@ func TestNodeIPAddressDAO_UpdateAddressHealthCount(t *testing.T) {
dbs.NotifyReady()
var tx *dbs.Tx
isChanged, err := SharedNodeIPAddressDAO.UpdateAddressHealthCount(tx, 1, true, 3, 3)
isChanged, err := SharedNodeIPAddressDAO.UpdateAddressHealthCount(tx, 1, true, 3, 3, false)
if err != nil {
t.Fatal(err)
}

View File

@@ -313,12 +313,15 @@ func (this *NodeClusterService) FindNodeClusterHealthCheckConfig(ctx context.Con
return nil, err
}
tx := this.NullTx()
var tx = this.NullTx()
config, err := models.SharedNodeClusterDAO.FindClusterHealthCheckConfig(tx, req.NodeClusterId)
if err != nil {
return nil, err
}
if config == nil {
return &pb.FindNodeClusterHealthCheckConfigResponse{HealthCheckJSON: nil}, nil
}
configJSON, err := json.Marshal(config)
if err != nil {
return nil, err