Add readiness check web endpoint
Some checks failed
Gitea Actions Demo / lint (push) Failing after 1m20s
Gitea Actions Demo / test (push) Has been skipped
Gitea Actions Demo / release-image (push) Has been skipped

This commit is contained in:
Ryan Cavicchioni 2024-07-27 16:41:16 -05:00
parent f131f64641
commit fcd11b751d
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.healthy?
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|