mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 12:43:54 -06:00
055cb55872
This allows probers to distinguish between liveness and readiness conditions
20 lines
406 B
Ruby
20 lines
406 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "read_only_header"
|
|
|
|
class ForumsController < ActionController::Base
|
|
include ReadOnlyHeader
|
|
|
|
before_action :check_readonly_mode
|
|
after_action :add_readonly_header
|
|
|
|
def status
|
|
if $shutdown # rubocop:disable Style/GlobalVars
|
|
render plain: "shutting down", status: (params[:shutdown_ok] ? 200 : 500)
|
|
else
|
|
render plain: "ok"
|
|
end
|
|
end
|
|
|
|
end
|