mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:46:06 -04:00
Ignore AS users when fetching push rules
By ignoring AS users early on when fetching push rules for a room we can avoid needlessly hitting the DB and filling up the caches.
This commit is contained in:
parent
baf9e74a73
commit
0163466d72
2 changed files with 18 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue