Fixed unit tests
This commit is contained in:
@@ -10,6 +10,8 @@ from pydantic import BaseModel
|
||||
import redis
|
||||
from celery import Celery
|
||||
|
||||
from database.connection import test_database_connection
|
||||
|
||||
# Initialize FastAPI app
|
||||
app = FastAPI(
|
||||
title="MyDocManager File Processor",
|
||||
@@ -68,6 +70,12 @@ async def health_check():
|
||||
health_status["dependencies"]["redis"] = "disconnected"
|
||||
health_status["status"] = "degraded"
|
||||
|
||||
# check MongoDB connection
|
||||
if test_database_connection():
|
||||
health_status["dependencies"]["mongodb"] = "connected"
|
||||
else:
|
||||
health_status["dependencies"]["mongodb"] = "disconnected"
|
||||
|
||||
return health_status
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user