MCPcopy
hub / github.com/psycopg/psycopg / _putconn

Method _putconn

psycopg_pool/psycopg_pool/pool.py:354–359  ·  view source on GitHub ↗
(self, conn: CT, from_getconn: bool)

Source from the content-addressed store, hash-verified

352 self.run_task(AddConnection(self))
353
354 def _putconn(self, conn: CT, from_getconn: bool) -> None:
355 # Use a worker to perform eventual maintenance work in a separate task
356 if self._reset:
357 self.run_task(ReturnConnection(self, conn, from_getconn=from_getconn))
358 else:
359 self._return_connection(conn, from_getconn=from_getconn)
360
361 def _maybe_close_connection(self, conn: CT) -> bool:
362 """Close a returned connection if necessary.

Callers 2

putconnMethod · 0.95

Calls 3

run_taskMethod · 0.95
_return_connectionMethod · 0.95
ReturnConnectionClass · 0.70

Tested by

no test coverage detected