From: Daniele Varrazzo Date: Sun, 14 Feb 2021 02:27:30 +0000 (+0100) Subject: Delete an eventual task-pool loop in StopWorker too X-Git-Tag: 3.0.dev0~87^2~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6f69b5df0e3e88461e05e0f51f9fd0452fd43b41;p=thirdparty%2Fpsycopg.git Delete an eventual task-pool loop in StopWorker too --- diff --git a/psycopg3/psycopg3/pool.py b/psycopg3/psycopg3/pool.py index 9f15b8994..03fc86b62 100644 --- a/psycopg3/psycopg3/pool.py +++ b/psycopg3/psycopg3/pool.py @@ -291,11 +291,11 @@ class ConnectionPool: logger.warning( "task run %s failed: %s: %s", task, e.__class__.__name__, e ) - if isinstance(task, StopWorker): - return # delete reference loops which may keep the pool alive del task.pool + if isinstance(task, StopWorker): + return del task def _connect(self) -> Connection: