forked from Github-Mirrors/canaille
refactor: memory model clears its cache when reading a model
This commit is contained in:
parent
0ba1c93152
commit
6601abaeb4
1 changed files with 5 additions and 1 deletions
|
@ -47,7 +47,11 @@ class MemoryModel(BackendModel):
|
|||
states = [cls.index()[id] for id in ids]
|
||||
|
||||
# initialize instances from the states
|
||||
return [cls(**state) for state in states]
|
||||
instances = [cls(**state) for state in states]
|
||||
for instance in instances:
|
||||
# TODO: maybe find a way to not initialize the cache in the first place?
|
||||
instance._cache = {}
|
||||
return instances
|
||||
|
||||
@classmethod
|
||||
def index(cls, class_name=None):
|
||||
|
|
Loading…
Reference in a new issue