mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-07 16:55:02 +08:00
增加审计日志、图表数据自动清理功能
This commit is contained in:
14
server/cron/start.go
Normal file
14
server/cron/start.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/go-co-op/gocron"
|
||||
)
|
||||
|
||||
func Start() {
|
||||
s := gocron.NewScheduler(time.Local)
|
||||
s.Cron("0 * * * *").Do(ClearAudit)
|
||||
s.Cron("0 * * * *").Do(ClearStatsInfo)
|
||||
s.StartAsync()
|
||||
}
|
Reference in New Issue
Block a user