Implement a more throughough cache-flush mechanism. This makes sure to flush foreignkey cache relations for objects not affected by flushing (normally objects with an NAttribute stored in them). Without ForeignKey flushing, the location of such objects would remain cached and drift out of sync, leading to content caches in turn desyncing. Resolves #1064.
This commit is contained in:
parent
15025c0586
commit
2b35140fe3
3 changed files with 15 additions and 15 deletions
|
|
@ -321,8 +321,6 @@ class SharedMemoryModel(with_metaclass(SharedMemoryModelBase, Model)):
|
|||
else:
|
||||
cls.__dbclass__.__instance_cache__ = dict((key, obj) for key, obj in cls.__dbclass__.__instance_cache__.items()
|
||||
if not obj.at_idmapper_flush())
|
||||
for ins in cls.__dbclass__.__instance_cache__.itervalues():
|
||||
ins.refresh_from_db()
|
||||
#flush_instance_cache = classmethod(flush_instance_cache)
|
||||
|
||||
# per-instance methods
|
||||
|
|
@ -349,8 +347,6 @@ class SharedMemoryModel(with_metaclass(SharedMemoryModelBase, Model)):
|
|||
if pk:
|
||||
if force or self.at_idmapper_flush():
|
||||
self.__class__.__dbclass__.__instance_cache__.pop(pk, None)
|
||||
else:
|
||||
self.refresh_from_db()
|
||||
|
||||
def delete(self, *args, **kwargs):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue