Dialyzer: pattern_match The pattern can never match the type {:diff, false}.

This commit is contained in:
Mark Felder 2024-09-06 11:27:07 -04:00
parent 1d0e3b1355
commit 06ce5e3b43

View file

@ -118,14 +118,13 @@ defmodule Pleroma.User.Backup do
end end
defp permitted?(user) do defp permitted?(user) do
with {_, %__MODULE__{inserted_at: inserted_at}} <- {:last, get_last(user)}, with {_, %__MODULE__{inserted_at: inserted_at}} <- {:last, get_last(user)} do
days = Config.get([__MODULE__, :limit_days]), days = Config.get([__MODULE__, :limit_days])
diff = Timex.diff(NaiveDateTime.utc_now(), inserted_at, :days), diff = Timex.diff(NaiveDateTime.utc_now(), inserted_at, :days)
{_, true} <- {:diff, diff > days} do
true diff > days
else else
{:last, nil} -> true {:last, nil} -> true
{:diff, false} -> false
end end
end end