summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2017-04-03 15:41:17 +0100
committerRichard van der Hoff <richard@matrix.org>2017-04-03 15:41:17 +0100
commitfeb496056ee1a6d30174a2594dbe01e24dd4fb25 (patch)
treeb8f916a783b9356838df7a5adb4edaafdfe3e17f
parentFix fixme in preserve_fn (diff)
downloadsynapse-feb496056ee1a6d30174a2594dbe01e24dd4fb25.tar.xz
preserve_fn some deferred-returning things
In `Notifier._on_new_room_event`, `preserve_fn` around its subroutines which
return deferreds, so that it is safe to call it with an active logcontext.
-rw-r--r--synapse/notifier.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/notifier.py b/synapse/notifier.py
index 3b206bb96b..e8177452a8 100644
--- a/synapse/notifier.py
+++ b/synapse/notifier.py
@@ -243,10 +243,13 @@ class Notifier(object):
     def _on_new_room_event(self, event, room_stream_id, extra_users=[]):
         """Notify any user streams that are interested in this room event"""
         # poke any interested application service.
-        self.appservice_handler.notify_interested_services(room_stream_id)
+        preserve_fn(self.appservice_handler.notify_interested_services)(
+            room_stream_id)
 
         if self.federation_sender:
-            self.federation_sender.notify_new_events(room_stream_id)
+            preserve_fn(self.federation_sender.notify_new_events)(
+                room_stream_id
+            )
 
         if event.type == EventTypes.Member and event.membership == Membership.JOIN:
             self._user_joined_room(event.state_key, event.room_id)