mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-21 02:04:26 +08:00
support periodically cleaning up expired tokens
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/mayswind/ezbookkeeping/pkg/services"
|
||||
)
|
||||
|
||||
var RemoveExpiredTokensJob = &CronJob{
|
||||
Name: "RemoveExpiredTokens",
|
||||
Description: "Periodically remove expired user tokens from the database.",
|
||||
Interval: 24 * time.Hour,
|
||||
Run: func() error {
|
||||
return services.Tokens.DeleteAllExpiredTokens(nil)
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user