From b599d34e1e21846af4b585da48ad69cb802a52cb Mon Sep 17 00:00:00 2001 From: TPV Date: Fri, 21 Aug 2026 07:52:21 -0700 Subject: [PATCH] added optional mongo url --- src/monitor_utils/database.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/monitor_utils/database.py b/src/monitor_utils/database.py index c582f7e..ffb2e90 100644 --- a/src/monitor_utils/database.py +++ b/src/monitor_utils/database.py @@ -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,