mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-06-20 23:34:12 -04:00
Async get event cache prep (#13242)
Some experimental prep work to enable external event caching based on #9379 & #12955. Doesn't actually move the cache at all, just lays the groundwork for async implemented caches. Signed off by Nick @ Beeper (@Fizzadar)
This commit is contained in:
parent
21eeacc995
commit
cc21a431f3
11 changed files with 86 additions and 26 deletions
|
@ -193,7 +193,10 @@ class CacheInvalidationWorkerStore(SQLBaseStore):
|
|||
relates_to: Optional[str],
|
||||
backfilled: bool,
|
||||
) -> None:
|
||||
self._invalidate_get_event_cache(event_id)
|
||||
# This invalidates any local in-memory cached event objects, the original
|
||||
# process triggering the invalidation is responsible for clearing any external
|
||||
# cached objects.
|
||||
self._invalidate_local_get_event_cache(event_id)
|
||||
self.have_seen_event.invalidate((room_id, event_id))
|
||||
|
||||
self.get_latest_event_ids_in_room.invalidate((room_id,))
|
||||
|
@ -208,7 +211,7 @@ class CacheInvalidationWorkerStore(SQLBaseStore):
|
|||
self._events_stream_cache.entity_has_changed(room_id, stream_ordering)
|
||||
|
||||
if redacts:
|
||||
self._invalidate_get_event_cache(redacts)
|
||||
self._invalidate_local_get_event_cache(redacts)
|
||||
# Caches which might leak edits must be invalidated for the event being
|
||||
# redacted.
|
||||
self.get_relations_for_event.invalidate((redacts,))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue