MCPcopy
hub / github.com/MagicStack/asyncpg / _maybe_cleanup

Method _maybe_cleanup

asyncpg/connection.py:2610–2618  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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
2621class _Callback(typing.NamedTuple):

Callers 2

set_max_sizeMethod · 0.95
putMethod · 0.95

Calls 1

_clear_entry_callbackMethod · 0.95

Tested by

no test coverage detected