mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Smaller timeout for MongoStorage connection
By default serverSelectionTimeoutMS=30000. This is too much
This commit is contained in:
parent
0df95a0276
commit
d88b7ec612
1 changed files with 4 additions and 1 deletions
|
|
@ -39,7 +39,10 @@ class MongoStorage(BaseStorage):
|
|||
|
||||
@classmethod
|
||||
def from_url(
|
||||
cls, url: str, connection_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Any
|
||||
cls,
|
||||
url: str,
|
||||
connection_kwargs: Optional[Dict[str, Any]] = {"serverSelectionTimeoutMS": 2000},
|
||||
**kwargs: Any,
|
||||
) -> "MongoStorage":
|
||||
"""
|
||||
Create an instance of :class:`MongoStorage` with specifying the connection string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue