No need to spawn() any more

This commit is contained in:
Floatingghost 2024-06-12 02:09:24 +01:00
parent ad52135bf5
commit 4d6fb43cbd
2 changed files with 1 additions and 12 deletions

View file

@ -26,12 +26,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
import Pleroma.Web.ActivityPub.Visibility, only: [get_visibility: 1, visible_for_user?: 2]
# This is a naive way to do this, just spawning a process per activity
# to fetch the preview. However it should be fine considering
# pagination is restricted to 40 activities at a time
defp fetch_rich_media_for_activities(activities) do
Enum.each(activities, fn activity ->
spawn(fn -> Card.get_by_activity(activity) end)
Card.get_by_activity(activity)
end)
end

View file

@ -93,14 +93,6 @@ def get_or_backfill_by_url(url, backfill_opts \\ %{}) do
end
end
@spec get_by_object(Object.t()) :: t() | nil | :error
def get_by_object(object) do
case HTML.extract_first_external_url_from_object(object) do
nil -> nil
url -> get_or_backfill_by_url(url)
end
end
@spec get_by_activity(Activity.t()) :: t() | nil | :error
# Fake/Draft activity
def get_by_activity(%Activity{id: "pleroma:fakeid"} = activity) do