diff options
author | Erik Johnston <erikj@jki.re> | 2019-04-02 18:23:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-02 18:23:32 +0100 |
commit | 3039d61baf7b4ab914a2d659737337cd09127a51 (patch) | |
tree | 672c4e457a5596a408423ff37c1ead65475f73b3 /synapse/push/emailpusher.py | |
parent | Transfer related groups on room upgrade (#4990) (diff) | |
parent | s/misc/feature/ (diff) | |
download | synapse-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/emailpusher.py')
-rw-r--r-- | synapse/push/emailpusher.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/synapse/push/emailpusher.py b/synapse/push/emailpusher.py index 50e1007d84..e8ee67401f 100644 --- a/synapse/push/emailpusher.py +++ b/synapse/push/emailpusher.py @@ -72,8 +72,15 @@ class EmailPusher(object): self._is_processing = False - def on_started(self): - if self.mailer is not None: + 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 and self.mailer is not None: self._start_processing() def on_stop(self): |