Store health check path in a string constant
Some checks failed
Run tests and linters / test (pull_request) Successful in 2m51s
Run tests and linters / lint (pull_request) Failing after 3s

This commit is contained in:
Jaroslav Groman 2026-05-25 13:26:55 +02:00
commit 3dce5e4f6a

View file

@ -35,12 +35,14 @@ from blockerbugs.models.update import Update
from blockerbugs.models.release import Release
from blockerbugs.controllers.forms import BugProposeForm
HEALTH_CHECK_PATH = '/_health'
main = Blueprint('main', __name__)
@app.before_request
def before_request():
if request.path == '/_health':
if request.path == HEALTH_CHECK_PATH:
return
g.milestones = Milestone.query.filter_by(active=True).order_by(Milestone.name).all()
g.version = __version__
@ -281,7 +283,7 @@ def index():
return display_current()
@main.route('/_health')
@main.route(HEALTH_CHECK_PATH)
def get_health_check():
"""Endpoint for OpenShift pod health checks (liveness and readiness probes).