mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-10 19:08:06 -05:00
Allow streaming cache invalidate all to workers. (#6749)
This commit is contained in:
parent
2093f83ea0
commit
5d7a6ad223
6 changed files with 69 additions and 15 deletions
|
|
@ -66,11 +66,16 @@ class BaseSlavedStore(SQLBaseStore):
|
|||
self._cache_id_gen.advance(token)
|
||||
for row in rows:
|
||||
if row.cache_func == CURRENT_STATE_CACHE_NAME:
|
||||
if row.keys is None:
|
||||
raise Exception(
|
||||
"Can't send an 'invalidate all' for current state cache"
|
||||
)
|
||||
|
||||
room_id = row.keys[0]
|
||||
members_changed = set(row.keys[1:])
|
||||
self._invalidate_state_caches(room_id, members_changed)
|
||||
else:
|
||||
self._attempt_to_invalidate_cache(row.cache_func, tuple(row.keys))
|
||||
self._attempt_to_invalidate_cache(row.cache_func, row.keys)
|
||||
|
||||
def _invalidate_cache_and_stream(self, txn, cache_func, keys):
|
||||
txn.call_after(cache_func.invalidate, keys)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue