Always warn if duplicate keys detected when caching a data model
This commit is contained in:
parent
9ddb9e2269
commit
a30a19c25b
|
@ -89,8 +89,9 @@ class ModelCacher(object):
|
||||||
if prog:
|
if prog:
|
||||||
prog.destroy()
|
prog.destroy()
|
||||||
|
|
||||||
if self.omit_duplicates and self.duplicate_keys:
|
if self.duplicate_keys:
|
||||||
log.info("will prune {} duplicated keys from cache".format(len(self.duplicate_keys)))
|
log.warning("found {} duplicated keys in cache".format(len(self.duplicate_keys)))
|
||||||
|
if self.omit_duplicates:
|
||||||
for key in self.duplicate_keys:
|
for key in self.duplicate_keys:
|
||||||
log.debug("removing duplicated key from cache: {}".format(repr(key)))
|
log.debug("removing duplicated key from cache: {}".format(repr(key)))
|
||||||
del self.instances[key]
|
del self.instances[key]
|
||||||
|
|
Loading…
Reference in a new issue