summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--changelog.d/4706.misc1
-rw-r--r--synapse/push/pusherpool.py8
2 files changed, 9 insertions, 0 deletions
diff --git a/changelog.d/4706.misc b/changelog.d/4706.misc
new file mode 100644
index 0000000000..73d1ddcc56
--- /dev/null
+++ b/changelog.d/4706.misc
@@ -0,0 +1 @@
+Avoid some redundant work when processing read receipts
diff --git a/synapse/push/pusherpool.py b/synapse/push/pusherpool.py
index 5a4e73ccd6..b2c92ce683 100644
--- a/synapse/push/pusherpool.py
+++ b/synapse/push/pusherpool.py
@@ -140,6 +140,10 @@ class PusherPool:
 
     @defer.inlineCallbacks
     def on_new_notifications(self, min_stream_id, max_stream_id):
+        if not self.pushers:
+            # nothing to do here.
+            return
+
         try:
             users_affected = yield self.store.get_push_action_users_in_range(
                 min_stream_id, max_stream_id
@@ -155,6 +159,10 @@ class PusherPool:
 
     @defer.inlineCallbacks
     def on_new_receipts(self, min_stream_id, max_stream_id, affected_room_ids):
+        if not self.pushers:
+            # nothing to do here.
+            return
+
         try:
             # Need to subtract 1 from the minimum because the lower bound here
             # is not inclusive