Refresh profiles in a background task

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-05-12 18:18:20 +02:00
parent 8c53ea442f
commit 4100b2f962
6 changed files with 40 additions and 15 deletions

View File

@@ -32,9 +32,10 @@ defmodule Mobilizon.Federation.ActivityPub.Refresher do
end
def refresh_profile(%Actor{type: type, url: url}) when type in [:Person, :Application] do
with {:ok, %Actor{outbox_url: outbox_url}} <- ActivityPubActor.make_actor_from_url(url),
with {:ok, %Actor{outbox_url: outbox_url} = actor} <-
ActivityPubActor.make_actor_from_url(url),
:ok <- fetch_collection(outbox_url, Relay.get_actor()) do
:ok
{:ok, actor}
end
end