(self)
| 324 | self._inactive_callback = None |
| 325 | |
| 326 | def _deactivate_inactive_connection(self) -> None: |
| 327 | if self._in_use is not None: |
| 328 | raise exceptions.InternalClientError( |
| 329 | 'attempting to deactivate an acquired connection') |
| 330 | |
| 331 | self._inactive_callback = None |
| 332 | if self._con is not None: |
| 333 | if (self.is_connected() and not self._pool.is_closing() and |
| 334 | self._pool.get_size() <= self._pool.get_min_size()): |
| 335 | # A floor connection needs no further inactivity checks. |
| 336 | # Acquiring and releasing it will arm a new timer. |
| 337 | return |
| 338 | |
| 339 | # The connection is idle and not in use, so it's fine to |
| 340 | # use terminate() instead of close(). |
| 341 | self._con.terminate() |
| 342 | |
| 343 | def _release_on_close(self) -> None: |
| 344 | self._maybe_cancel_inactive_callback() |
nothing calls this directly
no test coverage detected