commit: 7b134e7aa51e112cf1fb903a4d0497be861ec0d8
parent 0ec0ad85598ef42ca05d6407868bb5a2fd3ce18f
Author: nicole mikołajczyk <git@mkljczk.pl>
Date: Tue, 14 Oct 2025 07:38:59 +0200
optimize follow_request_count for own account view
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/pleroma/web/mastodon_api/views/account_view.ex b/lib/pleroma/web/mastodon_api/views/account_view.ex
@@ -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)