mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-07 11:53:52 -05:00
remove healthcheck.py changes
This commit is contained in:
@@ -50,11 +50,6 @@ class VerificationStatus(StrEnum):
|
||||
SUCCESS = "success"
|
||||
|
||||
|
||||
class HealthStatus(StrEnum):
|
||||
OK = "ok"
|
||||
ERROR = "error"
|
||||
|
||||
|
||||
class AuthType(StrEnum):
|
||||
EMAIL_AUTH = "email_auth"
|
||||
SMS_AUTH = "sms_auth"
|
||||
|
||||
@@ -5,7 +5,6 @@ from flask import current_app, jsonify, request
|
||||
from redis import RedisError
|
||||
|
||||
from app import status_api_client, version
|
||||
from app.enums import HealthStatus
|
||||
from app.extensions import redis_client
|
||||
from app.status import status
|
||||
from notifications_python_client.errors import HTTPError
|
||||
@@ -14,16 +13,16 @@ from notifications_python_client.errors import HTTPError
|
||||
@status.route("/_status", methods=["GET"])
|
||||
def show_status():
|
||||
if request.args.get("elb", None) or request.args.get("simple", None):
|
||||
return jsonify(status=HealthStatus.OK), 200
|
||||
return jsonify(status="ok"), 200
|
||||
else:
|
||||
try:
|
||||
api_status = status_api_client.get_status()
|
||||
except HTTPError as err:
|
||||
current_app.logger.exception("API failed to respond")
|
||||
return jsonify(status=HealthStatus.ERROR, message=str(err.message)), 500
|
||||
return jsonify(status="error", message=str(err.message)), 500
|
||||
return (
|
||||
jsonify(
|
||||
status=HealthStatus.OK,
|
||||
status="ok",
|
||||
api=api_status,
|
||||
git_commit=version.__git_commit__,
|
||||
build_time=version.__time__,
|
||||
@@ -61,10 +60,10 @@ def show_redis_status():
|
||||
)
|
||||
except HTTPError as err:
|
||||
current_app.logger.exception("API failed to respond")
|
||||
return jsonify(status=HealthStatus.ERROR, message=str(err.message)), 500
|
||||
return jsonify(status="error", message=str(err.message)), 500
|
||||
return (
|
||||
jsonify(
|
||||
status=HealthStatus.OK,
|
||||
status="ok",
|
||||
api=api_status,
|
||||
git_commit=version.__git_commit__,
|
||||
build_time=version.__time__,
|
||||
@@ -77,7 +76,7 @@ def show_redis_status():
|
||||
)
|
||||
return (
|
||||
jsonify(
|
||||
status=f"{HealthStatus.ERROR}: {err}",
|
||||
status=f"error: {err}",
|
||||
api=api_status,
|
||||
git_commit=version.__git_commit__,
|
||||
build_time=version.__time__,
|
||||
|
||||
Reference in New Issue
Block a user