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

This commit is contained in:
刘祥超
2022-07-07 20:31:12 +08:00
parent 4911198fe7
commit 24fcb48c75
8 changed files with 64 additions and 19 deletions

View File

@@ -360,3 +360,12 @@ func (this *NodeLogDAO) UpdateAllNodeLogsRead(tx *dbs.Tx) error {
Set("isRead", true).
UpdateQuickly()
}
// DeleteNodeLogs 删除某个节点上的日志
func (this *NodeLogDAO) DeleteNodeLogs(tx *dbs.Tx, role nodeconfigs.NodeRole, nodeId int64) error {
_, err := this.Query(tx).
Attr("nodeId", nodeId).
Attr("role", role).
Delete()
return err
}