Fix wrong argument order when calling NaiveDateTime.diff

This commit is contained in:
rinpatch 2019-09-18 18:52:33 +03:00
parent 84a40f6f26
commit a9c700ff15

View File

@ -42,7 +42,7 @@ defmodule Pleroma.Object do
%{updated_at: updated_at} = object = get_by_id(id) %{updated_at: updated_at} = object = get_by_id(id)
if opts[:interval] && if opts[:interval] &&
NaiveDateTime.diff(updated_at, NaiveDateTime.utc_now()) > 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
{:ok, %Object{} = object} -> {:ok, %Object{} = object} ->
object object