User.Query: Speed up recipients query.

This commit is contained in:
lain 2020-05-19 14:11:32 +02:00
commit a985bd57b4
3 changed files with 17 additions and 16 deletions

View file

@ -1204,7 +1204,9 @@ defmodule Pleroma.User do
def get_recipients_from_activity(%Activity{recipients: to, actor: actor}) do
to = [actor | to]
User.Query.build(%{recipients_from_activity: to, local: true, deactivated: false})
query = User.Query.build(%{recipients_from_activity: to, local: true, deactivated: false})
query
|> Repo.all()
end