From 69c27a518df16e0f6391009c04493a40d06e8cd4 Mon Sep 17 00:00:00 2001 From: Max Zuev Date: Wed, 25 Oct 2023 17:05:18 +0200 Subject: [PATCH] CLOUDSUPPORT-346222: init pool_size=1 for pg --- .../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]: