chore(storage): migrate to beanie2

This commit is contained in:
h
2025-07-21 01:39:10 +03:00
parent c5e4f3206b
commit bfa23d4db9
4 changed files with 319 additions and 333 deletions

View File

@@ -1,9 +1,9 @@
from beanie import init_beanie
from motor.motor_asyncio import AsyncIOMotorClient
from pymongo import AsyncMongoClient
from utils.env import env
client = AsyncIOMotorClient(env.db.connection_url)
client = AsyncMongoClient(env.db.connection_url)
async def init_db():

View File

@@ -22,9 +22,6 @@ class DynamicConfig(DynamicConfigBase, Document):
class Settings:
name = "config"
async def save(self): # noqa
await super().save() # noqa
@classmethod
async def get_or_create(cls):
config = await cls.find_one()