optimize follow_request_count for own account view

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk 2025-10-14 07:38:59 +02:00
commit 7b134e7aa5

View file

@ -357,8 +357,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
) do
count =
user
|> User.get_follow_requests()
|> length()
|> User.get_follow_requests_query()
|> Pleroma.Repo.aggregate(:count)
data
|> Kernel.put_in([:follow_requests_count], count)