mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 19:29:11 +00:00
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
|
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 @@ defmodule Pleroma.Stats 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
|
||||||
|
|
Loading…
Reference in a new issue