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

This commit is contained in:
GoEdgeLab
2022-07-07 20:31:12 +08:00
parent 7a80760419
commit 762173a842
8 changed files with 64 additions and 19 deletions

View File

@@ -51,12 +51,17 @@ func (this *UserNodeDAO) EnableUserNode(tx *dbs.Tx, id uint32) error {
}
// DisableUserNode 禁用条目
func (this *UserNodeDAO) DisableUserNode(tx *dbs.Tx, id int64) error {
func (this *UserNodeDAO) DisableUserNode(tx *dbs.Tx, nodeId int64) error {
_, err := this.Query(tx).
Pk(id).
Pk(nodeId).
Set("state", UserNodeStateDisabled).
Update()
return err
if err != nil {
return err
}
// 删除运行日志
return SharedNodeLogDAO.DeleteNodeLogs(tx, nodeconfigs.NodeRoleUser, nodeId)
}
// FindEnabledUserNode 查找启用中的条目