Spaces:
Sleeping
Sleeping
madhurithika22
deploy: add backend codebase and Dockerfile configuration for Hugging Face Spaces
35512c1 | from database.connection import db_client | |
| from core.config import settings | |
| async def get_db(): | |
| """Dependency to yield the active MongoDB instance or None if offline.""" | |
| if not db_client.client: | |
| return None | |
| try: | |
| # Return DB handle | |
| return db_client.client[settings.DB_NAME] | |
| except Exception: | |
| return None |