diff options
author | Erik Johnston <erik@matrix.org> | 2022-07-15 16:31:53 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2022-07-15 16:31:53 +0100 |
commit | cad555f07c20add1d754ab824d53540bd07b5652 (patch) | |
tree | f142080914c042b9b337a7a24f9c1ade7c222fc4 | |
parent | Fix mypy (diff) | |
download | synapse-cad555f07c20add1d754ab824d53540bd07b5652.tar.xz |
Better stuff
-rw-r--r-- | synapse/storage/databases/state/store.py | 6 | ||||
-rw-r--r-- | synapse/util/caches/dictionary_cache.py | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/synapse/storage/databases/state/store.py b/synapse/storage/databases/state/store.py index afbc85ad0c..0e38e5b5e4 100644 --- a/synapse/storage/databases/state/store.py +++ b/synapse/storage/databases/state/store.py @@ -202,7 +202,11 @@ 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) + 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(): diff --git a/synapse/util/caches/dictionary_cache.py b/synapse/util/caches/dictionary_cache.py index 4e5a96b5b4..869a267e94 100644 --- a/synapse/util/caches/dictionary_cache.py +++ b/synapse/util/caches/dictionary_cache.py @@ -126,7 +126,8 @@ class DictionaryCache(Generic[KT, DKT, DV]): return DictionaryEntry(True, set(), entry) all_entries = self.cache.get_multi( - (key,), _Sentinel.sentinel, update_metrics=False + (key,), + _Sentinel.sentinel, ) if all_entries is _Sentinel.sentinel: return DictionaryEntry(False, set(), {}) @@ -167,7 +168,6 @@ class DictionaryCache(Generic[KT, DKT, DV]): entry = self.cache.get( (key, _FullCacheKey.KEY), _Sentinel.sentinel, - update_metrics=False, update_last_access=False, ) if entry is _Sentinel.sentinel: |