feat: implement proxy management endpoints and MongoDB integration

This commit is contained in:
gabdevele
2026-04-12 00:55:29 +02:00 Unverified
parent 1b03ac7541
commit b4a84e70a2
6 changed files with 209 additions and 25 deletions
+12
View File
@@ -13,6 +13,18 @@ class _MongoDB:
mongodb = _MongoDB()
async def init_mongodb() -> None:
mongodb.client = AsyncIOMotorClient(settings.MONGODB_URI)
await ensure_mongodb_available()
async def close_mongodb() -> None:
client = mongodb.client
mongodb.client = None
if client is not None:
client.close()
async def get_database() -> AsyncIOMotorDatabase:
return mongodb.get_database()