No need to explicitly get the write lock since clear_composite_caches gets it for us

This commit is contained in:
Kovid Goyal 2021-05-05 22:06:32 +05:30
parent 1f50076bb8
commit 0a6010e712
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -686,8 +686,7 @@ class Cache(object):
composite_cache_needs_to_be_cleared = True composite_cache_needs_to_be_cleared = True
if composite_cache_needs_to_be_cleared: if composite_cache_needs_to_be_cleared:
try: try:
with self.write_lock: self.clear_composite_caches()
self.clear_composite_caches()
except LockingError: except LockingError:
# We can't clear the composite caches because a read lock is set. # We can't clear the composite caches because a read lock is set.
# As a consequence the value of a composite column that calls # As a consequence the value of a composite column that calls