Don't expose Cache object's trim method.

This commit is contained in:
Solderpunk 2023-11-13 20:24:54 +01:00
parent 053dcb7254
commit cdb2b0282c
1 changed files with 2 additions and 2 deletions

View File

@ -38,10 +38,10 @@ class Cache:
self.cache_timestamps[url] = time.time()
self.cache[url] = (mime, filename)
if len(self.cache) > _MAX_CACHE_SIZE:
self.trim()
self._trim()
self.validatecache()
def trim(self):
def _trim(self):
# Order cache entries by age
lru = [(t, u) for (u, t) in self.cache_timestamps.items()]
lru.sort()