Merge branch 'add_db_uri' of DigiFi/digifi-BankToProductCore into master
This commit is contained in:
@@ -118,7 +118,6 @@ def notification_callback():
|
|||||||
response = NotificationCallbackService.process_request(data)
|
response = NotificationCallbackService.process_request(data)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
# Health Check Endpoint
|
# Health Check Endpoint
|
||||||
@api.route("/health", methods=["GET"])
|
@api.route("/health", methods=["GET"])
|
||||||
def health_check():
|
def health_check():
|
||||||
@@ -129,6 +128,15 @@ def health_check():
|
|||||||
errors = []
|
errors = []
|
||||||
status = "ok"
|
status = "ok"
|
||||||
|
|
||||||
|
|
||||||
|
# Extract the database URI
|
||||||
|
try:
|
||||||
|
db_uri = db.engine.url.render_as_string(hide_password=False)
|
||||||
|
db_uri = db_uri
|
||||||
|
except Exception as e:
|
||||||
|
db_uri = "Unavailable"
|
||||||
|
|
||||||
|
|
||||||
# Check database connection
|
# Check database connection
|
||||||
try:
|
try:
|
||||||
logger.info(f"Database Health == : {SQLALCHEMY_DATABASE_URI}")
|
logger.info(f"Database Health == : {SQLALCHEMY_DATABASE_URI}")
|
||||||
@@ -159,6 +167,7 @@ def health_check():
|
|||||||
"status": status,
|
"status": status,
|
||||||
"db_status": db_status,
|
"db_status": db_status,
|
||||||
"events_service_status": events_service_status,
|
"events_service_status": events_service_status,
|
||||||
|
"db_uri": db_uri,
|
||||||
"errors": errors or None
|
"errors": errors or None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user