activitypub: move post rich media fetching to job queue
This commit is contained in:
parent
32d4630c9c
commit
57d11ac9db
|
@ -133,9 +133,7 @@ def insert(map, local \\ true, fake \\ false) when is_map(map) do
|
||||||
activity
|
activity
|
||||||
end
|
end
|
||||||
|
|
||||||
Task.start(fn ->
|
PleromaJobQueue.enqueue(:background, Pleroma.Web.RichMedia.Helpers, [:fetch, activity])
|
||||||
Pleroma.Web.RichMedia.Helpers.fetch_data_for_activity(activity)
|
|
||||||
end)
|
|
||||||
|
|
||||||
Notification.create_notifications(activity)
|
Notification.create_notifications(activity)
|
||||||
|
|
||||||
|
|
|
@ -34,4 +34,6 @@ def fetch_data_for_activity(%Activity{data: %{"type" => "Create"}} = activity) d
|
||||||
end
|
end
|
||||||
|
|
||||||
def fetch_data_for_activity(_), do: %{}
|
def fetch_data_for_activity(_), do: %{}
|
||||||
|
|
||||||
|
def perform(:fetch, %Activity{} = activity), do: fetch_data_for_activity(activity)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue