(self)
| 2608 | entry._cleanup_cb.cancel() |
| 2609 | |
| 2610 | def _maybe_cleanup(self): |
| 2611 | # Delete cache entries until the size of the cache is `max_size`. |
| 2612 | while len(self._entries) > self._max_size: |
| 2613 | old_query, old_entry = self._entries.popitem(last=False) |
| 2614 | self._clear_entry_callback(old_entry) |
| 2615 | |
| 2616 | # Let the connection know that the statement was removed |
| 2617 | # from the cache. |
| 2618 | self._on_remove(old_entry._statement) |
| 2619 | |
| 2620 | |
| 2621 | class _Callback(typing.NamedTuple): |
no test coverage detected