删除集群的时候同时删除相关节点运行日志

This commit is contained in:
刘祥超
2022-07-28 09:47:01 +08:00
parent 530954dd6c
commit 89a69e3165
5 changed files with 65 additions and 6 deletions

View File

@@ -46,12 +46,16 @@ func (this *NSClusterDAO) EnableNSCluster(tx *dbs.Tx, id int64) error {
}
// DisableNSCluster 禁用条目
func (this *NSClusterDAO) DisableNSCluster(tx *dbs.Tx, id int64) error {
func (this *NSClusterDAO) DisableNSCluster(tx *dbs.Tx, clusterId int64) error {
_, err := this.Query(tx).
Pk(id).
Pk(clusterId).
Set("state", NSClusterStateDisabled).
Update()
return err
if err != nil {
return err
}
return SharedNodeLogDAO.DeleteNodeLogsWithCluster(tx, nodeconfigs.NodeRoleDNS, clusterId)
}
// FindEnabledNSCluster 查找启用中的条目