Merge branch '518_instance_stats_fix' into 'develop'
[#518] Fix: /api/v1/instance ("domain_count"), /api/v1/instance/peers Closes #518 See merge request pleroma/pleroma!673
This commit is contained in:
commit
da4b670451
2 changed files with 24 additions and 7 deletions
|
|
@ -34,10 +34,11 @@ defmodule Pleroma.Stats do
|
|||
peers =
|
||||
from(
|
||||
u in Pleroma.User,
|
||||
select: fragment("distinct ?->'host'", u.info),
|
||||
select: fragment("distinct split_part(?, '@', 2)", u.nickname),
|
||||
where: u.local != ^true
|
||||
)
|
||||
|> Repo.all()
|
||||
|> Enum.filter(& &1)
|
||||
|
||||
domain_count = Enum.count(peers)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue