mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 13:54:55 -04:00
Refactor presence so we can prune user in room caches (#13313)
See #10826 and #10786 for context as to why we had to disable pruning on those caches. Now that `get_users_who_share_room_with_user` is called frequently only for presence, we just need to make calls to it less frequent and then we can remove the various levels of caching that is going on.
This commit is contained in:
parent
357561c1a2
commit
43adf2521c
4 changed files with 109 additions and 91 deletions
|
@ -80,6 +80,10 @@ class SQLBaseStore(metaclass=ABCMeta):
|
|||
)
|
||||
self._attempt_to_invalidate_cache("get_local_users_in_room", (room_id,))
|
||||
|
||||
# There's no easy way of invalidating this cache for just the users
|
||||
# that have changed, so we just clear the entire thing.
|
||||
self._attempt_to_invalidate_cache("does_pair_of_users_share_a_room", None)
|
||||
|
||||
for user_id in members_changed:
|
||||
self._attempt_to_invalidate_cache(
|
||||
"get_user_in_room_with_profile", (room_id, user_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue