summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2019-02-21 17:51:21 +0000
committerGitHub <noreply@github.com>2019-02-21 17:51:21 +0000
commit0abb094f1ada9c4a78a11eb06b205c00db826860 (patch)
tree823cfb34dcb0f99083c435e0fc9309513267ce95 /synapse
parentRun push_receipts_to_remotes as background job (#4707) (diff)
downloadsynapse-0abb094f1ada9c4a78a11eb06b205c00db826860.tar.xz
bail out early in on_new_receipts if no pushers (#4706)
Diffstat (limited to 'synapse')
-rw-r--r--synapse/push/pusherpool.py8
1 files changed, 8 insertions, 0 deletions
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