Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions guillotina/db/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,3 +688,13 @@ async def __aenter__(self):

async def __aexit__(self, *args):
return self.__exit__()

def __del__(self):
if self._db_conn is not None:
logger.error(
f"""
Found a leak of pg connection {self._db_conn} in txn {self}.
It's not possible to return the connection to the pool
(__del__ function is not async)
"""
)