summary refs log tree commit diff
path: root/synapse/util/distributor.py
diff options
context:
space:
mode:
authorRichard van der Hoff <github@rvanderhoff.org.uk>2017-11-15 11:13:53 +0000
committerGitHub <noreply@github.com>2017-11-15 11:13:53 +0000
commit1b83c09c034dfbe35b462404da0aca071ae1f65e (patch)
tree9020d3f64ad16f8c25b318653b702e91ae34d80b /synapse/util/distributor.py
parentMerge pull request #2650 from matrix-org/dbkr/push_include_content_option (diff)
parentRemove __PreservingContextDeferred too (diff)
downloadsynapse-1b83c09c034dfbe35b462404da0aca071ae1f65e.tar.xz
Merge pull request #2675 from matrix-org/rav/remove_broken_logcontext_funcs
Remove preserve_context_over_{fn, deferred}
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):