updated Postgres Service

This commit is contained in:
2025-04-01 17:37:03 +03:00
parent 4c87c4df91
commit 9e27893e8f
3 changed files with 291 additions and 13 deletions

View File

@@ -150,7 +150,9 @@ class CollectionContext:
self.client = MongoClient(
self.db_handler.uri, **self.db_handler.client_options
)
self.collection = self.client.get_database()[self.collection_name]
# Get database from URI
db_name = self.client.get_database().name
self.collection = self.client[db_name][self.collection_name]
# Enhance collection methods with retry capabilities
self._add_retry_capabilities()
@@ -201,7 +203,6 @@ class CollectionContext:
mongo_handler = MongoDBHandler(
uri=mongo_configs.url,
db_name=mongo_configs.DB,
max_pool_size=100,
min_pool_size=20,
max_idle_time_ms=60000,