chore(storage): migrate to beanie2
This commit is contained in:
@@ -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():
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user