summary refs log tree commit diff
path: root/synapse/push
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2022-09-30 17:40:33 +0100
committerGitHub <noreply@github.com>2022-09-30 17:40:33 +0100
commit535f8c8f7d64d4058500a5988278fd3026645164 (patch)
tree6b2e4d6f83964e5761ba976f359d684522b8de60 /synapse/push
parentUpdate mypy and mypy-zope, attempt 3 (#13993) (diff)
downloadsynapse-535f8c8f7d64d4058500a5988278fd3026645164.tar.xz
Skip filtering during push if there are no push actions (#13992)
Diffstat (limited to 'synapse/push')
-rw-r--r--synapse/push/bulk_push_rule_evaluator.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/push/bulk_push_rule_evaluator.py b/synapse/push/bulk_push_rule_evaluator.py
index 7bfe380543..4270438918 100644
--- a/synapse/push/bulk_push_rule_evaluator.py
+++ b/synapse/push/bulk_push_rule_evaluator.py
@@ -332,6 +332,11 @@ class BulkPushRuleEvaluator:
                 # Push rules say we should notify the user of this event
                 actions_by_user[uid] = actions
 
+        # If there aren't any actions then we can skip the rest of the
+        # processing.
+        if not actions_by_user:
+            return
+
         # This is a check for the case where user joins a room without being
         # allowed to see history, and then the server receives a delayed event
         # from before the user joined, which they should not be pushed for