added healthcheck setting to instance config
This commit is contained in:
parent
20deff75f1
commit
d35246c449
3 changed files with 10 additions and 3 deletions
|
|
@ -365,10 +365,15 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
|
|||
end
|
||||
|
||||
def healthcheck(conn, _params) do
|
||||
info = Pleroma.Healthcheck.system_info()
|
||||
info =
|
||||
if Pleroma.Config.get([:instance, :healthcheck]) do
|
||||
Pleroma.Healthcheck.system_info()
|
||||
else
|
||||
%{}
|
||||
end
|
||||
|
||||
conn =
|
||||
if info.healthy do
|
||||
if info[:healthy] do
|
||||
conn
|
||||
else
|
||||
Plug.Conn.put_status(conn, :service_unavailable)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue