Dialyzer: Function application with args (_ :: map()) will not succeed.
This commit is contained in:
parent
7955cd90e6
commit
b283b686c4
@ -99,9 +99,9 @@ defmodule Pleroma.Object do
|
|||||||
def get_by_id(nil), do: nil
|
def get_by_id(nil), do: nil
|
||||||
def get_by_id(id), do: Repo.get(Object, id)
|
def get_by_id(id), do: Repo.get(Object, id)
|
||||||
|
|
||||||
|
@spec get_by_id_and_maybe_refetch(integer(), list()) :: Object.t() | nil
|
||||||
def get_by_id_and_maybe_refetch(id, opts \\ []) do
|
def get_by_id_and_maybe_refetch(id, opts \\ []) do
|
||||||
%{updated_at: updated_at} = object = get_by_id(id)
|
with %Object{updated_at: updated_at} = object <- get_by_id(id) do
|
||||||
|
|
||||||
if opts[:interval] &&
|
if opts[:interval] &&
|
||||||
NaiveDateTime.diff(NaiveDateTime.utc_now(), updated_at) > opts[:interval] do
|
NaiveDateTime.diff(NaiveDateTime.utc_now(), updated_at) > opts[:interval] do
|
||||||
case Fetcher.refetch_object(object) do
|
case Fetcher.refetch_object(object) do
|
||||||
@ -115,6 +115,9 @@ defmodule Pleroma.Object do
|
|||||||
else
|
else
|
||||||
object
|
object
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
nil -> nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_by_ap_id(nil), do: nil
|
def get_by_ap_id(nil), do: nil
|
||||||
|
Loading…
Reference in New Issue
Block a user