mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Fixed unused import
This commit is contained in:
parent
42efa1f1af
commit
441e78a473
1 changed files with 4 additions and 2 deletions
|
|
@ -1,8 +1,8 @@
|
|||
import asyncio
|
||||
from contextlib import asynccontextmanager
|
||||
from typing import Any, AsyncGenerator, Dict, Optional
|
||||
|
||||
try:
|
||||
import motor
|
||||
from motor.motor_asyncio import AsyncIOMotorClient
|
||||
except ModuleNotFoundError as e:
|
||||
import warnings
|
||||
|
|
@ -42,6 +42,7 @@ class MongoStorage(BaseStorage):
|
|||
self._db = mongo.get_database(db_name)
|
||||
self._with_bot_id = with_bot_id
|
||||
self._with_destiny = with_destiny
|
||||
self._lock = asyncio.Lock()
|
||||
|
||||
@classmethod
|
||||
def from_url(
|
||||
|
|
@ -95,7 +96,8 @@ class MongoStorage(BaseStorage):
|
|||
bot: Bot,
|
||||
key: StorageKey,
|
||||
) -> AsyncGenerator[None, None]:
|
||||
yield None
|
||||
async with self._lock:
|
||||
yield None
|
||||
|
||||
async def set_state(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue