mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 16:07:33 +08:00
18 lines
470 B
Go
18 lines
470 B
Go
package cron
|
|
|
|
import (
|
|
"github.com/mayswind/ezbookkeeping/pkg/services"
|
|
)
|
|
|
|
// RemoveExpiredTokensJob represents the cron job which periodically remove expired user tokens from the database
|
|
var RemoveExpiredTokensJob = &CronJob{
|
|
Name: "RemoveExpiredTokens",
|
|
Description: "Periodically remove expired user tokens from the database.",
|
|
Period: CronJobFixedHourPeriod{
|
|
Hour: 0,
|
|
},
|
|
Run: func() error {
|
|
return services.Tokens.DeleteAllExpiredTokens(nil)
|
|
},
|
|
}
|