Skip to content

Commit

Permalink
Merge pull request #992 from phenobarbital/bump-version
Browse files Browse the repository at this point in the history
ignore cancelledError on pg pool
  • Loading branch information
phenobarbital authored Feb 21, 2024
2 parents 4f42cfb + ea28905 commit 60d45bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions asyncdb/drivers/pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ async def release(self, connection=None, timeout=5):
try:
await self._pool.release(conn, timeout=timeout)
return True
except asyncio.exceptions.CancelledError:
pass
except InterfaceError as err:
raise ProviderError(message=f"Release Interface Error: {err}") from err
except InternalClientError as err:
Expand All @@ -323,6 +325,8 @@ async def wait_close(self, gracefully=True, timeout=5):
if self._connection:
await self._pool.release(self._connection, timeout=timeout)
self._connection = None
except asyncio.exceptions.CancelledError:
pass
except (InternalClientError, InterfaceError) as err:
raise ProviderError(f"Release Interface Error: {err}") from err
except Exception as err:
Expand Down

0 comments on commit 60d45bb

Please sign in to comment.