Merge pull request #4254 from ostcar/fix_partial_cache
Make sure the cache is ensured before manipulating it
This commit is contained in:
commit
a64d436884
@ -133,6 +133,11 @@ class ElementCache:
|
||||
|
||||
Returns the new generated change_id.
|
||||
"""
|
||||
if not self.ensured:
|
||||
raise RuntimeError(
|
||||
"Call element_cache.ensure_cache before changing elements."
|
||||
)
|
||||
|
||||
deleted_elements = []
|
||||
changed_elements = []
|
||||
for element_id, data in elements.items():
|
||||
@ -265,6 +270,11 @@ class ElementCache:
|
||||
# If the restricted_data_cache is not used, there is nothing to do
|
||||
return
|
||||
|
||||
if not self.ensured:
|
||||
raise RuntimeError(
|
||||
"Call element_cache.ensure_cache before updating restricted data."
|
||||
)
|
||||
|
||||
# Try to write a special key.
|
||||
# If this succeeds, there is noone else currently updating the cache.
|
||||
# TODO: Make a timeout. Else this could block forever
|
||||
|
Loading…
Reference in New Issue
Block a user