projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
streamer: use direct object for filter checks when there is no valid child object...
[akkoma]
/
lib
/
pleroma
/
stats.ex
diff --git
a/lib/pleroma/stats.ex
b/lib/pleroma/stats.ex
index df80fbaa41f0d62fd252444b16cef22325e1d9cc..8154a09b754a75b36d72b8e01700f0f2612cec7f 100644
(file)
--- a/
lib/pleroma/stats.ex
+++ b/
lib/pleroma/stats.ex
@@
-68,12
+68,7
@@
defmodule Pleroma.Stats do
domain_count = Enum.count(peers)
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)
user_count = Repo.aggregate(User.Query.build(%{local: true, active: true}), :count, :id)