discourse/app/controllers/forums_controller.rb
Kane York 055cb55872 DEV: shutdown_ok parameter to /srv/status
This allows probers to distinguish between liveness and readiness conditions
2020-03-09 14:06:13 -07:00

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