From ab1772a940f0ff98ac66bf7104b05595c6395718 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Thu, 23 Apr 2026 15:15:16 +0200 Subject: [PATCH] Shrink psycopg-pool to (0, 1) when cleaning connections When min size is zero, max size must be greater than 0. Closes #14795 (grafted from 357525621ea68bc99d688ddf04f9912905c9f3a0) --HG-- branch : 8.0 --- trytond/trytond/backend/postgresql/database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trytond/trytond/backend/postgresql/database.py b/trytond/trytond/backend/postgresql/database.py index ce73dcdcad..27968f6940 100644 --- a/trytond/trytond/backend/postgresql/database.py +++ b/trytond/trytond/backend/postgresql/database.py @@ -221,7 +221,7 @@ class Database(DatabaseInterface): for database in list(databases.values()): if ((now - database._last_use).total_seconds() > timeout and database.name != name): - database._connpool.resize(0, 0) + database._connpool.resize(0, 1) if not (inst := databases.get(name)): with cls._lock: