Skip to content

Commit f307895

Browse files
committed
exempt /status from maintenance redirect
1 parent 6ffaf15 commit f307895

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

app/main/routes.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ def index():
2020
return render_template("index.html")
2121

2222

23+
@bp.route("/status", methods=["GET"])
24+
def status():
25+
return "OK"
26+
27+
2328
@bp.route("/maintenance-mode", methods=["GET"])
2429
def maintenance_mode_page():
2530
if not current_app.config["MAINTENANCE_MODE"]:
@@ -86,5 +91,9 @@ def csrf_error(error):
8691
@bp.before_request
8792
def maintenance_mode_middleware():
8893
maintenance_url = url_for("main.maintenance_mode_page")
89-
if current_app.config["MAINTENANCE_MODE"] and request.path != maintenance_url:
94+
exempt_urls = [
95+
maintenance_url,
96+
url_for("main.status"),
97+
]
98+
if current_app.config["MAINTENANCE_MODE"] and request.path not in exempt_urls:
9099
return redirect(maintenance_url)

helm_deploy/laa-access-civil-legal-aid/templates/deployment.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ spec:
4444
protocol: TCP
4545
livenessProbe:
4646
httpGet:
47-
path: /
47+
path: /status
4848
port: http
4949
readinessProbe:
5050
httpGet:
51-
path: /
51+
path: /status
5252
port: http

0 commit comments

Comments
 (0)