2018-01-14 20:43:26 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-05-06 10:07:49 -04:00
|
|
|
require "read_only_header"
|
2019-05-03 06:21:07 -04:00
|
|
|
|
2019-01-21 01:37:04 -05:00
|
|
|
class ForumsController < ActionController::Base
|
2019-05-06 10:07:49 -04:00
|
|
|
include ReadOnlyHeader
|
2019-05-03 06:21:07 -04:00
|
|
|
|
|
|
|
before_action :check_readonly_mode
|
|
|
|
after_action :add_readonly_header
|
|
|
|
|
2013-02-05 14:16:51 -05:00
|
|
|
def status
|
2021-03-15 00:41:59 -04:00
|
|
|
if params[:cluster]
|
|
|
|
if GlobalSetting.cluster_name.nil?
|
|
|
|
return render plain: "cluster name not configured", status: 500
|
|
|
|
elsif GlobalSetting.cluster_name != params[:cluster]
|
|
|
|
return render plain: "cluster name does not match", status: 500
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-12-03 04:05:53 -05:00
|
|
|
if $shutdown # rubocop:disable Style/GlobalVars
|
2020-03-06 18:15:55 -05:00
|
|
|
render plain: "shutting down", status: (params[:shutdown_ok] ? 200 : 500)
|
2013-02-05 14:16:51 -05:00
|
|
|
else
|
2019-05-06 10:07:49 -04:00
|
|
|
render plain: "ok"
|
2013-02-05 14:16:51 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|