Generate instance stats on startup

This commit is contained in:
Mark Felder 2020-03-04 13:33:26 -06:00
parent 5992c256ad
commit cdb05633a6
1 changed files with 3 additions and 12 deletions

View File

@ -10,19 +10,10 @@ defmodule Pleroma.Stats do
use GenServer use GenServer
@init_state %{
peers: [],
stats: %{
domain_count: 0,
status_count: 0,
user_count: 0
}
}
def start_link(_) do def start_link(_) do
GenServer.start_link( GenServer.start_link(
__MODULE__, __MODULE__,
@init_state, nil,
name: __MODULE__ name: __MODULE__
) )
end end
@ -53,8 +44,8 @@ def get_peers do
peers peers
end end
def init(args) do def init(_args) do
{:ok, args} {:ok, get_stat_data()}
end end
def handle_call(:force_update, _from, _state) do def handle_call(:force_update, _from, _state) do