log which cache items have been pruned
This commit is contained in:
parent
cb2b054fde
commit
8e5d0871c8
|
@ -47,9 +47,14 @@ class ModelCache:
|
|||
|
||||
def prune(self):
|
||||
total = len(self.cache)
|
||||
if total > self.limit:
|
||||
overage = total - self.limit
|
||||
if overage > 0:
|
||||
removed = self.cache[:overage]
|
||||
logger.info(
|
||||
"removing models from cache, %s of %s", (total - self.limit), total
|
||||
"removing %s of %s models from cache, %s",
|
||||
overage,
|
||||
total,
|
||||
[m[0] for m in removed],
|
||||
)
|
||||
self.cache[:] = self.cache[-self.limit :]
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue