Add readiness check web endpoint
All checks were successful
Gitea Actions Demo / lint (push) Successful in 1m23s
Gitea Actions Demo / test (push) Successful in 1m18s
Gitea Actions Demo / release-image (push) Successful in 1m0s

This commit is contained in:
Ryan Cavicchioni 2024-07-27 16:41:16 -05:00
parent f131f64641
commit 7fc61df477
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D

8
app.rb
View File

@ -250,6 +250,14 @@ post "/livez/sleep" do
"ok\n"
end
get "/readyz" do
error 503 unless Ready.instance.ready?
return Ready.instance.to_json if request.env["HTTP_ACCEPT"] == "application/json"
Ready.instance.to_s
end
get "/uuid" do
n = params.fetch(:n, 1).to_i
stream do |out|