summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2019-02-22 15:29:16 +0000
committerGitHub <noreply@github.com>2019-02-22 15:29:16 +0000
commitd14e94bae49e3d2ec2ba5ea1ebd36e6b39b7dcc1 (patch)
tree2155320ecca321530b1ecd9793f31e355cf0211c /synapse
parentMerge pull request #4715 from matrix-org/erikj/fix_state_invalidation (diff)
parentAdd missing return (diff)
downloadsynapse-d14e94bae49e3d2ec2ba5ea1ebd36e6b39b7dcc1.tar.xz
Merge pull request #4716 from matrix-org/erikj/pusher_logging
Fix up pusher logging a bit
Diffstat (limited to 'synapse')
-rw-r--r--synapse/push/httppusher.py5
-rw-r--r--synapse/push/pusher.py2
-rw-r--r--synapse/push/pusherpool.py10
3 files changed, 16 insertions, 1 deletions
diff --git a/synapse/push/httppusher.py b/synapse/push/httppusher.py

index 899a5253d8..e65f8c63d3 100644 --- a/synapse/push/httppusher.py +++ b/synapse/push/httppusher.py
@@ -97,6 +97,11 @@ class HttpPusher(object): pusherdict['pushkey'], ) + if self.data is None: + raise PusherConfigException( + "data can not be null for HTTP pusher" + ) + if 'url' not in self.data: raise PusherConfigException( "'url' required in data for HTTP pusher" diff --git a/synapse/push/pusher.py b/synapse/push/pusher.py
index 368d5094be..b33f2a357b 100644 --- a/synapse/push/pusher.py +++ b/synapse/push/pusher.py
@@ -56,7 +56,7 @@ class PusherFactory(object): f = self.pusher_types.get(kind, None) if not f: return None - logger.info("creating %s pusher for %r", kind, pusherdict) + logger.debug("creating %s pusher for %r", kind, pusherdict) return f(self.hs, pusherdict) def _create_email_pusher(self, _hs, pusherdict): diff --git a/synapse/push/pusherpool.py b/synapse/push/pusherpool.py
index b2c92ce683..abf1a1a9c1 100644 --- a/synapse/push/pusherpool.py +++ b/synapse/push/pusherpool.py
@@ -19,6 +19,7 @@ import logging from twisted.internet import defer from synapse.metrics.background_process_metrics import run_as_background_process +from synapse.push import PusherConfigException from synapse.push.pusher import PusherFactory logger = logging.getLogger(__name__) @@ -222,6 +223,15 @@ class PusherPool: """ try: p = self.pusher_factory.create_pusher(pusherdict) + except PusherConfigException as e: + logger.warning( + "Pusher incorrectly configured user=%s, appid=%s, pushkey=%s: %s", + pusherdict.get('user_name'), + pusherdict.get('app_id'), + pusherdict.get('pushkey'), + e, + ) + return except Exception: logger.exception("Couldn't start a pusher: caught Exception") return