summary refs log tree commit diff
path: root/synapse/push/pusher.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2016-05-17 10:43:58 +0100
committerMark Haines <mark.haines@matrix.org>2016-05-17 10:43:58 +0100
commit523d5bcd0b4883c5046e52d62db59ff588e342c1 (patch)
tree2e03fdf537731d9a8d1e8f7a0feaaeb0c9d84eb8 /synapse/push/pusher.py
parentMove SyncHandler out of the Handlers object (diff)
parentMerge pull request #786 from matrix-org/matthew/email_notifs_tuning (diff)
downloadsynapse-523d5bcd0b4883c5046e52d62db59ff588e342c1.tar.xz
Merge remote-tracking branch 'origin/develop' into markjh/liberate_sync_handler
Diffstat (limited to 'synapse/push/pusher.py')
-rw-r--r--synapse/push/pusher.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/synapse/push/pusher.py b/synapse/push/pusher.py
index e6c0806415..de9c33b936 100644
--- a/synapse/push/pusher.py
+++ b/synapse/push/pusher.py
@@ -18,6 +18,17 @@ from httppusher import HttpPusher
 import logging
 logger = logging.getLogger(__name__)
 
+# We try importing this if we can (it will fail if we don't
+# have the optional email dependencies installed). We don't
+# yet have the config to know if we need the email pusher,
+# but importing this after daemonizing seems to fail
+# (even though a simple test of importing from a daemonized
+# process works fine)
+try:
+    from synapse.push.emailpusher import EmailPusher
+except:
+    pass
+
 
 def create_pusher(hs, pusherdict):
     logger.info("trying to create_pusher for %r", pusherdict)
@@ -28,7 +39,6 @@ def create_pusher(hs, pusherdict):
 
     logger.info("email enable notifs: %r", hs.config.email_enable_notifs)
     if hs.config.email_enable_notifs:
-        from synapse.push.emailpusher import EmailPusher
         PUSHER_TYPES["email"] = EmailPusher
         logger.info("defined email pusher type")