mirror of
https://github.com/plausible/analytics.git
synced 2024-12-22 17:11:36 +03:00
15 lines
318 B
Elixir
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
|