X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fstats.ex;h=8154a09b754a75b36d72b8e01700f0f2612cec7f;hb=6a716e3fe5290df80af72e3ad5e45ee3afb581a8;hp=a3b8a4d669783e6c19b4a56f78c39e6eb394a1d6;hpb=31d576de0c91019d80e465984d4423779e7ccede;p=akkoma diff --git a/lib/pleroma/stats.ex b/lib/pleroma/stats.ex index a3b8a4d66..8154a09b7 100644 --- a/lib/pleroma/stats.ex +++ b/lib/pleroma/stats.ex @@ -32,7 +32,7 @@ defmodule Pleroma.Stats do end def init(args) do - Process.send_after(self(), :run_update, @interval) + Process.send(self(), :run_update, []) {:ok, args} end @@ -68,12 +68,7 @@ defmodule Pleroma.Stats do domain_count = Enum.count(peers) - status_query = - from(u in User.Query.build(%{local: true}), - select: fragment("sum((?->>'note_count')::int)", u.info) - ) - - status_count = Repo.one(status_query) + status_count = Repo.aggregate(User.Query.build(%{local: true}), :sum, :note_count) user_count = Repo.aggregate(User.Query.build(%{local: true, active: true}), :count, :id)