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