mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-08 05:54:59 -04:00
Improve the performance of calculating ignored users in large rooms (#9024)
This allows for efficiently finding which users ignore a particular user. Co-authored-by: Erik Johnston <erik@matrix.org>
This commit is contained in:
parent
1d5c021a45
commit
23d701864f
6 changed files with 304 additions and 34 deletions
|
@ -203,14 +203,18 @@ class BulkPushRuleEvaluator:
|
|||
|
||||
condition_cache = {} # type: Dict[str, bool]
|
||||
|
||||
# If the event is not a state event check if any users ignore the sender.
|
||||
if not event.is_state():
|
||||
ignorers = await self.store.ignored_by(event.sender)
|
||||
else:
|
||||
ignorers = set()
|
||||
|
||||
for uid, rules in rules_by_user.items():
|
||||
if event.sender == uid:
|
||||
continue
|
||||
|
||||
if not event.is_state():
|
||||
is_ignored = await self.store.is_ignored_by(event.sender, uid)
|
||||
if is_ignored:
|
||||
continue
|
||||
if uid in ignorers:
|
||||
continue
|
||||
|
||||
display_name = None
|
||||
profile_info = room_members.get(uid)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue