mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:16:07 -04:00
Replace DeferredCache with LruCache where possible (#8563)
Most of these uses don't need a full-blown DeferredCache; LruCache is lighter and more appropriate.
This commit is contained in:
parent
79c1f973ce
commit
97647b33c2
8 changed files with 30 additions and 27 deletions
|
@ -76,14 +76,16 @@ class SQLBaseStore(metaclass=ABCMeta):
|
|||
"""
|
||||
|
||||
try:
|
||||
if key is None:
|
||||
getattr(self, cache_name).invalidate_all()
|
||||
else:
|
||||
getattr(self, cache_name).invalidate(tuple(key))
|
||||
cache = getattr(self, cache_name)
|
||||
except AttributeError:
|
||||
# We probably haven't pulled in the cache in this worker,
|
||||
# which is fine.
|
||||
pass
|
||||
return
|
||||
|
||||
if key is None:
|
||||
cache.invalidate_all()
|
||||
else:
|
||||
cache.invalidate(tuple(key))
|
||||
|
||||
|
||||
def db_to_json(db_content):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue