Auto cleanning up auth context cache

This commit is contained in:
2024-03-23 13:04:25 +08:00
parent e7c84a91a2
commit f88fdd7fe5
2 changed files with 51 additions and 12 deletions

View File

@ -66,14 +66,8 @@ func main() {
// Configure timed tasks
quartz := cron.New(cron.WithLogger(cron.VerbosePrintfLogger(&log.Logger)))
quartz.AddFunc("@every 60m", func() {
log.Info().Msg("Running auto sign off...")
if tx := services.PerformAutoSignoff(); tx.Error != nil {
log.Error().Err(tx.Error).Msg("An error occurred when running auto sign off...")
} else {
log.Info().Int64("affected", tx.RowsAffected).Msg("Auto sign off accomplished.")
}
})
quartz.AddFunc("@every 60m", services.DoAutoSignoff)
quartz.AddFunc("@every 60m", services.DoAutoAuthCleanup)
quartz.Run()
// Messages