summary refs log tree commit diff
path: root/synapse/replication
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-03-01 12:05:33 +0000
committerErik Johnston <erik@matrix.org>2018-03-01 12:05:33 +0000
commit126b9bf96f2c989e7402b5e0177ee39a2a20940e (patch)
tree74b8e313e1e5c069c4c7eb8ae05eb3807500aa9b /synapse/replication
parentDon't do preserve_fn for every request (diff)
downloadsynapse-126b9bf96f2c989e7402b5e0177ee39a2a20940e.tar.xz
Log in the correct places
Diffstat (limited to 'synapse/replication')
-rw-r--r--synapse/replication/http/send_event.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/replication/http/send_event.py b/synapse/replication/http/send_event.py
index 665a56d2e6..70f2fe456a 100644
--- a/synapse/replication/http/send_event.py
+++ b/synapse/replication/http/send_event.py
@@ -72,9 +72,10 @@ def send_event_to_master(client, host, port, requester, event, context,
                 break
             except CodeMessageException as e:
                 if e.code != 504:
-                    logger.warn("send_event request timed out")
                     raise
 
+            logger.warn("send_event request timed out")
+
             # If we timed out we probably don't need to worry about backing
             # off too much, but lets just wait a little anyway.
             yield sleep(1)
@@ -119,11 +120,12 @@ class ReplicationSendEventRestServlet(RestServlet):
     def on_PUT(self, request, event_id):
         result = self.response_cache.get(event_id)
         if not result:
-            logger.warn("Returning cached response")
             result = self.response_cache.set(
                 event_id,
                 self._handle_request(request)
             )
+        else:
+            logger.warn("Returning cached response")
         return make_deferred_yieldable(result)
 
     @preserve_fn