Merge pull request 'added optional mongo url' (#14) from development into main
Reviewed-on: #14
This commit was merged in pull request #14.
This commit is contained in:
commit
2a5d649f90
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