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
This commit is contained in:
Sergi Almacellas Abellana
2026-04-23 15:15:16 +02:00
parent f539e7f5e5
commit ab1772a940
@@ -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: