From fcd11b751d0e861448c69775245d9e037f36fa68 Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Sat, 27 Jul 2024 16:41:16 -0500 Subject: [PATCH] Add readiness check web endpoint --- app.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app.rb b/app.rb index 0ffda20..b4d38e9 100644 --- a/app.rb +++ b/app.rb @@ -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|