Merge branch 'develop' into feature/reports-groups-and-multiple-state-update
[akkoma] / lib / pleroma / stats.ex
index df80fbaa41f0d62fd252444b16cef22325e1d9cc..8154a09b754a75b36d72b8e01700f0f2612cec7f 100644 (file)
@@ -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)