diff --git a/lib/pleroma/stats.ex b/lib/pleroma/stats.ex index c47a0f9de..04ea76ca7 100644 --- a/lib/pleroma/stats.ex +++ b/lib/pleroma/stats.ex @@ -10,6 +10,7 @@ defmodule Pleroma.Stats do alias Pleroma.CounterCache alias Pleroma.Repo alias Pleroma.User + alias Pleroma.Instance @interval :timer.seconds(300) @@ -64,16 +65,11 @@ defmodule Pleroma.Stats do } } def calculate_stat_data do - peers = + domain_count = from( - u in User, - select: fragment("distinct split_part(?, '@', 2)", u.nickname), - where: u.local != ^true + i in Instance ) - |> Repo.all() - |> Enum.filter(& &1) - - domain_count = Enum.count(peers) + |> Repo.aggregate(:count, :id) status_count = Repo.aggregate(User.Query.build(%{local: true}), :sum, :note_count)