mirror of https://github.com/bjdgyc/anylink.git
18 lines
360 B
Go
18 lines
360 B
Go
package cron
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/bjdgyc/anylink/sessdata"
|
|
"github.com/go-co-op/gocron"
|
|
)
|
|
|
|
func Start() {
|
|
s := gocron.NewScheduler(time.Local)
|
|
s.Cron("0 * * * *").Do(ClearAudit)
|
|
s.Cron("0 * * * *").Do(ClearStatsInfo)
|
|
s.Cron("0 * * * *").Do(ClearUserActLog)
|
|
s.Every(1).Day().At("00:00").Do(sessdata.CloseUserLimittimeSession)
|
|
s.StartAsync()
|
|
}
|