diff --git a/backend/app/api/main.go b/backend/app/api/main.go index 09191a4..bb76e69 100644 --- a/backend/app/api/main.go +++ b/backend/app/api/main.go @@ -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 {