1
0
Fork 0

declare missing cache

This commit is contained in:
Sean Sube 2023-02-13 18:15:02 -06:00
parent f43f793148
commit 8dc1ea7f1f
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 2 additions and 1 deletions

View File

@ -9,10 +9,11 @@ class ModelCache:
limit: int limit: int
def __init__(self, limit: int) -> None: def __init__(self, limit: int) -> None:
self.cache = []
self.limit = limit self.limit = limit
def drop(self, tag: str, key: Any) -> None: def drop(self, tag: str, key: Any) -> None:
self.cache = [ self.cache[:] = [
model for model in self.cache if model[0] != tag and model[1] != key model for model in self.cache if model[0] != tag and model[1] != key
] ]