MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / _maybe_cleanup

Method _maybe_cleanup

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

Source from the content-addressed store, hash-verified

2663 entry._cleanup_cb.cancel()
2664
2665 def _maybe_cleanup(self):
2666 # Delete cache entries until the size of the cache is `max_size`.
2667 while len(self._entries) > self._max_size:
2668 old_query, old_entry = self._entries.popitem(last=False)
2669 self._clear_entry_callback(old_entry)
2670
2671 # Let the connection know that the statement was removed
2672 # from the cache.
2673 self._on_remove(old_entry._statement)
2674
2675
2676class _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