mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 12:35:01 -04:00
Make DictionaryCache have better expiry properties (#13292)
This commit is contained in:
parent
13341dde5a
commit
0b87eb8e0c
7 changed files with 358 additions and 43 deletions
|
@ -202,7 +202,14 @@ class StateGroupDataStore(StateBackgroundUpdateStore, SQLBaseStore):
|
|||
requests state from the cache, if False we need to query the DB for the
|
||||
missing state.
|
||||
"""
|
||||
cache_entry = cache.get(group)
|
||||
# If we are asked explicitly for a subset of keys, we only ask for those
|
||||
# from the cache. This ensures that the `DictionaryCache` can make
|
||||
# better decisions about what to cache and what to expire.
|
||||
dict_keys = None
|
||||
if not state_filter.has_wildcards():
|
||||
dict_keys = state_filter.concrete_types()
|
||||
|
||||
cache_entry = cache.get(group, dict_keys=dict_keys)
|
||||
state_dict_ids = cache_entry.value
|
||||
|
||||
if cache_entry.full or state_filter.is_full():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue