details:   https://code.tryton.org/tryton/commit/357525621ea6
branch:    default
user:      Sergi Almacellas Abellana <[email protected]>
date:      Thu Apr 23 15:15:16 2026 +0200
description:
        Shrink psycopg-pool to (0, 1) when cleaning connections

        When min size is zero, max size must be greater than 0.

        Closes #14795
diffstat:

 trytond/trytond/backend/postgresql/database.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 53c7ac46de94 -r 357525621ea6 
trytond/trytond/backend/postgresql/database.py
--- a/trytond/trytond/backend/postgresql/database.py    Tue Apr 14 09:29:14 
2026 +0200
+++ b/trytond/trytond/backend/postgresql/database.py    Thu Apr 23 15:15:16 
2026 +0200
@@ -221,7 +221,7 @@
             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:

Reply via email to