From c970e8a704322adbc2693c8ff4b656585ad6530f Mon Sep 17 00:00:00 2001 From: Max Zuev Date: Thu, 26 Oct 2023 12:10:02 +0200 Subject: [PATCH] CLOUDSUPPORT-346222: init pool_size=1 for pg (#42) --- .../core/postgresql_base/async_adapters_postgres.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dl_connector_postgresql/dl_connector_postgresql/core/postgresql_base/async_adapters_postgres.py b/lib/dl_connector_postgresql/dl_connector_postgresql/core/postgresql_base/async_adapters_postgres.py index b60dc7a62..b67876cac 100644 --- a/lib/dl_connector_postgresql/dl_connector_postgresql/core/postgresql_base/async_adapters_postgres.py +++ b/lib/dl_connector_postgresql/dl_connector_postgresql/core/postgresql_base/async_adapters_postgres.py @@ -168,7 +168,7 @@ def _convert_date(self, s: str, ignoretz: bool) -> datetime: async def create_conn_pool(self, db_name_from_query: str) -> asyncpg.Pool: db_name = self.get_db_name_for_query(db_name_from_query) conn_line = self.get_conn_line(db_name=db_name) - return await asyncpg.create_pool(conn_line, statement_cache_size=0) + return await asyncpg.create_pool(conn_line, min_size=1, statement_cache_size=0) @asynccontextmanager async def _get_connection(self, db_name_from_query: str) -> AsyncIterator[asyncpg.Connection]: