summary refs log tree commit diff
path: root/synapse/util/distributor.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-12-07 14:24:01 +0000
committerErik Johnston <erik@matrix.org>2017-12-07 14:24:01 +0000
commitd8a6c734fa1ab6681431c43885ced627e5e672e0 (patch)
tree4ba6a510997e38e829c6a6b0aa53caace4e7b872 /synapse/util/distributor.py
parentCopy dict in update_membership too (diff)
parentMerge pull request #2723 from matrix-org/matthew/search-all-local-users (diff)
downloadsynapse-d8a6c734fa1ab6681431c43885ced627e5e672e0.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/createroom_content
Diffstat (limited to 'synapse/util/distributor.py')
-rw-r--r--synapse/util/distributor.py22
1 files changed, 7 insertions, 15 deletions
diff --git a/synapse/util/distributor.py b/synapse/util/distributor.py
index e68f94ce77..734331caaa 100644
--- a/synapse/util/distributor.py
+++ b/synapse/util/distributor.py
@@ -13,32 +13,24 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from twisted.internet import defer
+import logging
 
-from synapse.util.logcontext import (
-    PreserveLoggingContext, preserve_context_over_fn
-)
+from twisted.internet import defer
 
 from synapse.util import unwrapFirstError
-
-import logging
-
+from synapse.util.logcontext import PreserveLoggingContext
 
 logger = logging.getLogger(__name__)
 
 
 def user_left_room(distributor, user, room_id):
-    return preserve_context_over_fn(
-        distributor.fire,
-        "user_left_room", user=user, room_id=room_id
-    )
+    with PreserveLoggingContext():
+        distributor.fire("user_left_room", user=user, room_id=room_id)
 
 
 def user_joined_room(distributor, user, room_id):
-    return preserve_context_over_fn(
-        distributor.fire,
-        "user_joined_room", user=user, room_id=room_id
-    )
+    with PreserveLoggingContext():
+        distributor.fire("user_joined_room", user=user, room_id=room_id)
 
 
 class Distributor(object):