add task to purge invitation tokens

This commit is contained in:
Hayden 2022-10-14 17:14:17 -08:00
parent 15dc75fce6
commit 67d421db5d

View file

@ -138,6 +138,14 @@ func run(cfg *config.Config) error {
Msg("failed to purge expired tokens")
}
})
go app.startBgTask(time.Duration(24)*time.Hour, func() {
_, err := app.repos.Groups.InvitationPurge(context.Background())
if err != nil {
log.Error().
Err(err).
Msg("failed to purge expired invitations")
}
})
// TODO: Remove through external API that does setup
if cfg.Demo {