Generate instance stats on startup
This commit is contained in:
parent
5992c256ad
commit
cdb05633a6
1 changed files with 3 additions and 12 deletions
|
@ -10,19 +10,10 @@ defmodule Pleroma.Stats do
|
|||
|
||||
use GenServer
|
||||
|
||||
@init_state %{
|
||||
peers: [],
|
||||
stats: %{
|
||||
domain_count: 0,
|
||||
status_count: 0,
|
||||
user_count: 0
|
||||
}
|
||||
}
|
||||
|
||||
def start_link(_) do
|
||||
GenServer.start_link(
|
||||
__MODULE__,
|
||||
@init_state,
|
||||
nil,
|
||||
name: __MODULE__
|
||||
)
|
||||
end
|
||||
|
@ -53,8 +44,8 @@ def get_peers do
|
|||
peers
|
||||
end
|
||||
|
||||
def init(args) do
|
||||
{:ok, args}
|
||||
def init(_args) do
|
||||
{:ok, get_stat_data()}
|
||||
end
|
||||
|
||||
def handle_call(:force_update, _from, _state) do
|
||||
|
|
Loading…
Reference in a new issue