(self, stmt)
| 1620 | self._stmts_to_close.clear() |
| 1621 | |
| 1622 | def _maybe_gc_stmt(self, stmt): |
| 1623 | if ( |
| 1624 | stmt.refs == 0 |
| 1625 | and stmt.name |
| 1626 | and not self._stmt_cache.has( |
| 1627 | (stmt.query, stmt.record_class, stmt.ignore_custom_codec) |
| 1628 | ) |
| 1629 | ): |
| 1630 | # If low-level `stmt` isn't referenced from any high-level |
| 1631 | # `PreparedStatement` object and is not in the `_stmt_cache`: |
| 1632 | # |
| 1633 | # * mark it as closed, which will make it non-usable |
| 1634 | # for any `PreparedStatement` or for methods like |
| 1635 | # `Connection.fetch()`. |
| 1636 | # |
| 1637 | # * schedule it to be formally closed on the server. |
| 1638 | stmt.mark_closed() |
| 1639 | self._stmts_to_close.add(stmt) |
| 1640 | |
| 1641 | async def _cleanup_stmts(self): |
| 1642 | # Called whenever we create a new prepared statement in |
no test coverage detected