Skip to content

Commit 75b9cdf

Browse files
authored
CDPT-1059 Enable maintenance mode (#698)
1 parent 73b3dec commit 75b9cdf

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

app/controllers/application_controller.rb

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ class ApplicationController < ActionController::Base
22
include SecurityHandling
33
include ErrorHandling
44

5+
before_action :maintenance_mode
6+
57
# This is required to get request attributes in to the production logs.
68
# See the various lograge configurations in `production.rb`.
79
def append_info_to_payload(payload)
@@ -49,4 +51,8 @@ def initialize_disclosure_check(attributes = {})
4951
session[:disclosure_check_id] = disclosure_check.id
5052
end
5153
end
54+
55+
def maintenance_mode
56+
render "errors/maintenance" unless Rails.env.test?
57+
end
5258
end

config/locales/en/errors.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,4 @@ en:
127127
maintenance:
128128
page_title: Service Maintenance
129129
heading: Service Maintenance
130-
lead_text: Sorry, this service is currently not available because of routine maintenance and will be back up shortly.
130+
lead_text: This service is currently unavailable

0 commit comments

Comments
 (0)