1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-26 01:38:36 +00:00

Merge branch 'fix-pruning-old-app-activations' into 'main'

fix(apps): fix pruning old application device activations

See merge request framasoft/mobilizon!1411
This commit is contained in:
Thomas Citharel 2023-06-06 12:10:28 +00:00
commit 80f73a34a6

View file

@ -426,7 +426,7 @@ defmodule Mobilizon.Applications do
@spec prune_old_application_device_activations(pos_integer()) :: {non_neg_integer(), nil}
def prune_old_application_device_activations(lifetime) do
exp = DateTime.add(DateTime.utc_now(), -lifetime)
exp = DateTime.utc_now() |> DateTime.add(-lifetime) |> DateTime.to_unix()
ApplicationDeviceActivation
|> where([at], at.expires_in < ^exp)