mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 01:14:48 -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
|
@ -337,6 +337,9 @@ class LruCache(Generic[KT, VT]):
|
|||
self.set = cache_set
|
||||
self.setdefault = cache_set_default
|
||||
self.pop = cache_pop
|
||||
# `invalidate` is exposed for consistency with DeferredCache, so that it can be
|
||||
# invalidated by the cache invalidation replication stream.
|
||||
self.invalidate = cache_pop
|
||||
if cache_type is TreeCache:
|
||||
self.del_multi = cache_del_multi
|
||||
self.len = synchronized(cache_len)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue