[#1335] User AP ID relations fetching performance optimizations.

This commit is contained in:
Ivan Tashkinov 2019-11-20 12:19:07 +03:00
commit 555edd01ab
4 changed files with 70 additions and 20 deletions

View file

@ -130,7 +130,7 @@ defmodule Pleroma.Web.Streamer.Worker do
defp should_send?(%User{} = user, %Activity{} = item) do
%{block: blocked_ap_ids, mute: muted_ap_ids, reblog_mute: reblog_muted_ap_ids} =
User.related_ap_ids(user, [:block, :mute, :reblog_mute])
User.outgoing_relations_ap_ids(user, [:block, :mute, :reblog_mute])
recipient_blocks = MapSet.new(blocked_ap_ids ++ muted_ap_ids)
recipients = MapSet.new(item.recipients)