增加审计日志、图表数据自动清理功能

This commit is contained in:
lanrenwo
2022-10-12 10:04:18 +08:00
parent 2c8474a478
commit 82dfb5d04f
13 changed files with 267 additions and 6 deletions

View File

@@ -0,0 +1,20 @@
package cron
import (
"github.com/bjdgyc/anylink/base"
"github.com/bjdgyc/anylink/dbdata"
)
// 清除访问审计日志
func ClearAudit() {
lifeDay, timesUp := isClearTime()
if !timesUp {
return
}
// 当审计日志永久保存,则退出
if lifeDay <= 0 {
return
}
affected, err := dbdata.ClearAccessAudit(getTimeAgo(lifeDay))
base.Info("Cron ClearAudit: ", affected, err)
}