added optional mongo url
This commit is contained in:
1 parent
b071ac35bf
commit
b599d34e1e
1 file changed
+5
-2
@@ -66,15 +66,18 @@ def resolve_alerts_collection(
|
||||
|
||||
|
||||
@cache
|
||||
def get_mongo_client() -> AsyncIOMotorClient:
|
||||
def get_mongo_client(mongo_url: str = MONGO_URL) -> AsyncIOMotorClient:
|
||||
"""Return a cached Motor client configured for the shared cluster.
|
||||
|
||||
Args:
|
||||
mongo_url: The mongo url to use for connections.
|
||||
|
||||
Returns:
|
||||
The pooled, timezone-aware Motor client.
|
||||
"""
|
||||
|
||||
return AsyncIOMotorClient(
|
||||
MONGO_URL,
|
||||
mongo_url,
|
||||
minPoolSize=10,
|
||||
connectTimeoutMS=20_000,
|
||||
socketTimeoutMS=60_000,
|
||||
|
||||
Reference in new issue
Block a user