added optional mongo url

This commit is contained in:
TPV committed 2026-08-21 07:52:21 -07:00
1 parent b071ac35bf
commit b599d34e1e
1 file changed
+5 -2
+5 -2
View File
@@ -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,