You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
analytics/lib/workers/clean_invitations.ex

15 lines
318 B
Elixir

defmodule Plausible.Workers.CleanInvitations do
use Plausible.Repo
use Oban.Worker, queue: :clean_invitations
@impl Oban.Worker
def perform(_job) do
Repo.delete_all(
from i in Plausible.Auth.Invitation,
where: i.inserted_at < fragment("now() - INTERVAL '48 hours'")
)
:ok
end
end