MCPcopy
hub / github.com/psycopg/psycopg / close

Method close

psycopg_pool/psycopg_pool/_compat.py:52–60  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

50 """
51
52 def close(self) -> None:
53 if pool := getattr(self, "_pool", None):
54 # Connection currently checked out from the pool.
55 # Instead of closing it, return it to the pool.
56 pool.putconn(self)
57 else:
58 # Connection not part of any pool, or currently into the pool.
59 # Close the connection for real.
60 super().close()
61
62
63__all__ = [

Callers 1

closeMethod · 0.45

Calls 1

putconnMethod · 0.45

Tested by

no test coverage detected