diff options
author | Erik Johnston <erikj@jki.re> | 2016-11-23 15:21:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-23 15:21:52 +0000 |
commit | b2d6e63b79e4eee8ea8e9439b12786e010acc3b7 (patch) | |
tree | f41b5b12bd9db514061720dbf36bfd33b02ced3e /synapse/storage/push_rule.py | |
parent | Merge pull request #1640 from matrix-org/kegan/sync-perf (diff) | |
parent | Ignore AS users when fetching push rules (diff) | |
download | synapse-b2d6e63b79e4eee8ea8e9439b12786e010acc3b7.tar.xz |
Merge pull request #1641 from matrix-org/erikj/as_pushers
Ignore AS users when fetching push rules
Diffstat (limited to 'synapse/storage/push_rule.py')
-rw-r--r-- | synapse/storage/push_rule.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/synapse/storage/push_rule.py b/synapse/storage/push_rule.py index 49721656b6..cbec255966 100644 --- a/synapse/storage/push_rule.py +++ b/synapse/storage/push_rule.py @@ -156,12 +156,20 @@ class PushRuleStore(SQLBaseStore): event=event, ) - local_users_in_room = set(u for u in users_in_room if self.hs.is_mine_id(u)) + # We ignore app service users for now. This is so that we don't fill + # up the `get_if_users_have_pushers` cache with AS entries that we + # know don't have pushers, nor even read receipts. + local_users_in_room = set( + u for u in users_in_room + if self.hs.is_mine_id(u) + and not self.get_if_app_services_interested_in_user(u) + ) # users in the room who have pushers need to get push rules run because # that's how their pushers work if_users_with_pushers = yield self.get_if_users_have_pushers( - local_users_in_room, on_invalidate=cache_context.invalidate, + local_users_in_room, + on_invalidate=cache_context.invalidate, ) user_ids = set( uid for uid, have_pusher in if_users_with_pushers.items() if have_pusher |