projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into stable
[akkoma]
/
lib
/
pleroma
/
stats.ex
diff --git
a/lib/pleroma/stats.ex
b/lib/pleroma/stats.ex
index 3e3f24c2c21cae836bd7831c5c4b59d04c7dff51..c47a0f9defc10845f16df145667151824cb0998c 100644
(file)
--- a/
lib/pleroma/stats.ex
+++ b/
lib/pleroma/stats.ex
@@
-11,7
+11,7
@@
defmodule Pleroma.Stats do
alias Pleroma.Repo
alias Pleroma.User
alias Pleroma.Repo
alias Pleroma.User
- @interval :timer.seconds(
6
0)
+ @interval :timer.seconds(
30
0)
def start_link(_) do
GenServer.start_link(
def start_link(_) do
GenServer.start_link(
@@
-85,14
+85,24
@@
defmodule Pleroma.Stats do
where: not u.invisible
)
where: not u.invisible
)
+ remote_users_query =
+ from(u in User,
+ where: u.is_active == true,
+ where: u.local == false,
+ where: not is_nil(u.nickname),
+ where: not u.invisible
+ )
+
user_count = Repo.aggregate(users_query, :count, :id)
user_count = Repo.aggregate(users_query, :count, :id)
+ remote_user_count = Repo.aggregate(remote_users_query, :count, :id)
%{
peers: peers,
stats: %{
domain_count: domain_count,
status_count: status_count || 0,
%{
peers: peers,
stats: %{
domain_count: domain_count,
status_count: status_count || 0,
- user_count: user_count
+ user_count: user_count,
+ remote_user_count: remote_user_count
}
}
end
}
}
end