mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-12 09:32:46 -04:00
Add cache for get_membership_from_event_ids
(#12272)
This should speed up push rule calculations for rooms with large numbers of local users when the main push rule cache fails. Co-authored-by: reivilibre <oliverw@matrix.org>
This commit is contained in:
parent
38adf14998
commit
7ca8ee67a5
6 changed files with 72 additions and 22 deletions
|
@ -1745,6 +1745,13 @@ class PersistEventsStore:
|
|||
(event.state_key,),
|
||||
)
|
||||
|
||||
# The `_get_membership_from_event_id` is immutable, except for the
|
||||
# case where we look up an event *before* persisting it.
|
||||
txn.call_after(
|
||||
self.store._get_membership_from_event_id.invalidate,
|
||||
(event.event_id,),
|
||||
)
|
||||
|
||||
# We update the local_current_membership table only if the event is
|
||||
# "current", i.e., its something that has just happened.
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue