summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorDaniel Wagner-Hall <daniel@matrix.org>2015-09-22 13:34:29 +0100
committerDaniel Wagner-Hall <daniel@matrix.org>2015-09-22 13:34:29 +0100
commitb6e0303c833bb37891294046598d48cafe2b1c9e (patch)
tree8c6560cddc667c50d34bb512cc311c8330f6702e /synapse
parentAdd docstring (diff)
downloadsynapse-b6e0303c833bb37891294046598d48cafe2b1c9e.tar.xz
Catch stats-reporting errors
Diffstat (limited to '')
-rwxr-xr-xsynapse/app/homeserver.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index b4429bd4f3..21840e4a28 100755
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -701,10 +701,13 @@ def run(hs):
             stats["daily_messages"] = daily_messages
 
         logger.info("Reporting stats to matrix.org: %s" % (stats,))
-        hs.get_simple_http_client().put_json(
-            "https://matrix.org/report-usage-stats/push",
-            stats
-        )
+        try:
+            yield hs.get_simple_http_client().put_json(
+                "https://matrix.org/report-usage-stats/push",
+                stats
+            )
+        except Exception as e:
+            logger.warn("Error reporting stats: %s", e)
 
     if hs.config.report_stats:
         phone_home_task = task.LoopingCall(phone_stats_home)