Add readiness check web endpoint

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|