summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2020-03-04 13:33:26 -0600
committerMark Felder <feld@FreeBSD.org>2020-03-04 13:33:26 -0600
commitcdb05633a6dbc7633f55cd462bdee82e44942caf (patch)
tree2fd7d0ab415ca238a04c2444956bf95a8877bde1
parent5992c256ad7c5bc8207240c9d51e03964e50eb64 (diff)
Generate instance stats on startup
-rw-r--r--lib/pleroma/stats.ex15
1 files changed, 3 insertions, 12 deletions
diff --git a/lib/pleroma/stats.ex b/lib/pleroma/stats.ex
index 33f50dda8..4446562ac 100644
--- a/lib/pleroma/stats.ex
+++ b/lib/pleroma/stats.ex
@@ -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 @@ defmodule Pleroma.Stats 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