Return a connection to the loving hands of its pool. Use this function only paired with a `getconn()`. You don't need to use it if you use the much more comfortable `connection()` context manager.
(self, conn: CT)
| 317 | self.run_task(AddConnection(self, growing=True)) |
| 318 | |
| 319 | def putconn(self, conn: CT) -> None: |
| 320 | """Return a connection to the loving hands of its pool. |
| 321 | |
| 322 | Use this function only paired with a `getconn()`. You don't need to use |
| 323 | it if you use the much more comfortable `connection()` context manager. |
| 324 | """ |
| 325 | # Quick check to discard the wrong connection |
| 326 | self._check_pool_putconn(conn) |
| 327 | |
| 328 | logger.info("returning connection to %r", self.name) |
| 329 | if self._maybe_close_connection(conn): |
| 330 | return |
| 331 | |
| 332 | self._putconn(conn, from_getconn=False) |
| 333 | |
| 334 | def drain(self) -> None: |
| 335 | """ |