summary refs log tree commit diff
path: root/synapse/push/httppusher.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2019-04-02 18:23:32 +0100
committerGitHub <noreply@github.com>2019-04-02 18:23:32 +0100
commit3039d61baf7b4ab914a2d659737337cd09127a51 (patch)
tree672c4e457a5596a408423ff37c1ead65475f73b3 /synapse/push/httppusher.py
parentTransfer related groups on room upgrade (#4990) (diff)
parents/misc/feature/ (diff)
downloadsynapse-3039d61baf7b4ab914a2d659737337cd09127a51.tar.xz
Merge pull request #4991 from matrix-org/erikj/stagger_push_startup
Make starting pushers faster during start up
Diffstat (limited to 'synapse/push/httppusher.py')
-rw-r--r--synapse/push/httppusher.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/synapse/push/httppusher.py b/synapse/push/httppusher.py
index e65f8c63d3..fac05aa44c 100644
--- a/synapse/push/httppusher.py
+++ b/synapse/push/httppusher.py
@@ -112,8 +112,16 @@ class HttpPusher(object):
         self.data_minus_url.update(self.data)
         del self.data_minus_url['url']
 
-    def on_started(self):
-        self._start_processing()
+    def on_started(self, should_check_for_notifs):
+        """Called when this pusher has been started.
+
+        Args:
+            should_check_for_notifs (bool): Whether we should immediately
+                check for push to send. Set to False only if it's known there
+                is nothing to send
+        """
+        if should_check_for_notifs:
+            self._start_processing()
 
     def on_new_notifications(self, min_stream_ordering, max_stream_ordering):
         self.max_stream_ordering = max(max_stream_ordering, self.max_stream_ordering or 0)