chore: restructure project directory and update Dockerfile paths
Build and Push to Registry / build (push) Successful in 8s

This commit is contained in:
2026-04-12 00:27:30 +02:00 Unverified
parent 22235790d6
commit a4d73efa77
15 changed files with 9 additions and 6 deletions
+24
View File
@@ -0,0 +1,24 @@
from motor.motor_asyncio import AsyncIOMotorClient, AsyncIOMotorDatabase
from core.config import settings
class _MongoDB:
client: AsyncIOMotorClient | None = None
def get_database(self) -> AsyncIOMotorDatabase:
if self.client is None:
raise RuntimeError("MongoDB client has not been initialized")
return self.client[settings.MONGODB_DB_NAME]
mongodb = _MongoDB()
async def get_database() -> AsyncIOMotorDatabase:
return mongodb.get_database()
async def ensure_mongodb_available() -> None:
client = mongodb.client
if client is None:
raise RuntimeError("MongoDB client has not been initialized")
await client.admin.command("ping")