X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fhealthcheck.ex;h=f97d14432b27d1858e0df990d71b22b5b10b0519;hb=c3f00447afc67b460e63b531e4f2432bfaa37bdb;hp=646fb3b9d1bbe7c7c622e46009efdc18a7326a64;hpb=05862ded7a156ad6db16a70ec90045a2149da97d;p=akkoma 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 +# 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 ->