summaryrefslogtreecommitdiff
path: root/lib/healthcheck.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/healthcheck.ex')
-rw-r--r--lib/healthcheck.ex8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/healthcheck.ex b/lib/healthcheck.ex
index 646fb3b9d..f97d14432 100644
--- a/lib/healthcheck.ex
+++ b/lib/healthcheck.ex
@@ -1,3 +1,7 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.Healthcheck do
@moduledoc """
Module collects metrics about app and assign healthy status.
@@ -29,13 +33,13 @@ defmodule Pleroma.Healthcheck do
end
defp assign_db_info(healthcheck) do
- database = Application.get_env(:pleroma, Repo)[:database]
+ database = Pleroma.Config.get([Repo, :database])
query =
"select state, count(pid) from pg_stat_activity where datname = '#{database}' group by state;"
result = Repo.query!(query)
- pool_size = Application.get_env(:pleroma, Repo)[:pool_size]
+ pool_size = Pleroma.Config.get([Repo, :pool_size])
db_info =
Enum.reduce(result.rows, %{active: 0, idle: 0}, fn [state, cnt], states ->