Don't include appservice users when calculating push rules (#13332)

This can cause a lot of extra load on servers with lots of appservice users. Introduced in #13078
This commit is contained in:
Erik Johnston 2022-07-20 12:06:13 +01:00 committed by GitHub
parent 6fccd72f42
commit b4ae3b0d44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 93 additions and 0 deletions

View file

@ -131,6 +131,13 @@ class BulkPushRuleEvaluator:
local_users = await self.store.get_local_users_in_room(event.room_id)
# Filter out appservice users.
local_users = [
u
for u in local_users
if not self.store.get_if_app_services_interested_in_user(u)
]
# if this event is an invite event, we may need to run rules for the user
# who's been invited, otherwise they won't get told they've been invited
if event.type == EventTypes.Member and event.membership == Membership.INVITE: