Compare commits

..
2 Commits
Author SHA1 Message Date
TPV 2a5d649f90 Merge pull request 'added optional mongo url' (#14) from development into main
Reviewed-on: #14
2026-08-21 14:52:50 +00:00
TPV b599d34e1e added optional mongo url 2026-08-21 07:52:21 -07:00
+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,