[#518] Fixed /api/v1/instance ("domain_count" value) and /api/v1/instance/peers responses.

This commit is contained in:
Ivan Tashkinov 2019-01-16 11:07:46 +03:00
commit 90433b988e
2 changed files with 24 additions and 7 deletions

View file

@ -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)