Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a5d649f90 | ||
|
|
b599d34e1e |
@@ -66,15 +66,18 @@ def resolve_alerts_collection(
|
|||||||
|
|
||||||
|
|
||||||
@cache
|
@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.
|
"""Return a cached Motor client configured for the shared cluster.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
mongo_url: The mongo url to use for connections.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The pooled, timezone-aware Motor client.
|
The pooled, timezone-aware Motor client.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return AsyncIOMotorClient(
|
return AsyncIOMotorClient(
|
||||||
MONGO_URL,
|
mongo_url,
|
||||||
minPoolSize=10,
|
minPoolSize=10,
|
||||||
connectTimeoutMS=20_000,
|
connectTimeoutMS=20_000,
|
||||||
socketTimeoutMS=60_000,
|
socketTimeoutMS=60_000,
|
||||||
|
|||||||
Reference in new issue
Block a user