Don't expose Cache object's trim method.
This commit is contained in:
parent
053dcb7254
commit
cdb2b0282c
4
cache.py
4
cache.py
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue