Load all users at once in timelines.

This commit is contained in:
lain 2018-04-02 16:27:36 +02:00
commit b3b7ab5d9a
5 changed files with 94 additions and 30 deletions

View file

@ -50,10 +50,13 @@ defmodule Pleroma.Web.ActivityPub.Utils do
changeset = Object.context_mapping(context)
case Repo.insert(changeset) do
{:ok, object} -> object
{:ok, object} ->
object
# This should be solved by an upsert, but it seems ecto
# has problems accessing the constraint inside the jsonb.
{:error, _} -> Object.get_cached_by_ap_id(context)
{:error, _} ->
Object.get_cached_by_ap_id(context)
end
end