Feature/826 healthcheck endpoint
This commit is contained in:
parent
7fcbda702e
commit
88f0be9693
7 changed files with 120 additions and 0 deletions
|
|
@ -363,4 +363,17 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
|
|||
def captcha(conn, _params) do
|
||||
json(conn, Pleroma.Captcha.new())
|
||||
end
|
||||
|
||||
def healthcheck(conn, _params) do
|
||||
info = Pleroma.Healthcheck.system_info()
|
||||
|
||||
conn =
|
||||
if info.healthy do
|
||||
conn
|
||||
else
|
||||
Plug.Conn.put_status(conn, :service_unavailable)
|
||||
end
|
||||
|
||||
json(conn, info)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue