summary refs log tree commit diff
path: root/synapse/util/__init__.py
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2015-12-04 14:15:41 +0000
committerMark Haines <mjark@negativecurvature.net>2015-12-04 14:15:41 +0000
commit3c85a317d603bcbf2cc9c0b5b4ebcef1c9014db8 (patch)
tree9e531f36780ec5c39bd56671f6cac4afb1d10877 /synapse/util/__init__.py
parentMerge pull request #419 from matrix-org/markjh/reuse_captcha_client (diff)
parentAdd comments to explain why we are hardcoding RUSAGE_THREAD (diff)
downloadsynapse-3c85a317d603bcbf2cc9c0b5b4ebcef1c9014db8.tar.xz
Merge pull request #420 from matrix-org/markjh/resource_usage
Track the cpu used in the main thread by each logging context
Diffstat (limited to 'synapse/util/__init__.py')
-rw-r--r--synapse/util/__init__.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/synapse/util/__init__.py b/synapse/util/__init__.py
index d69c7cb991..2170746025 100644
--- a/synapse/util/__init__.py
+++ b/synapse/util/__init__.py
@@ -64,8 +64,7 @@ class Clock(object):
         current_context = LoggingContext.current_context()
 
         def wrapped_callback(*args, **kwargs):
-            with PreserveLoggingContext():
-                LoggingContext.thread_local.current_context = current_context
+            with PreserveLoggingContext(current_context):
                 callback(*args, **kwargs)
 
         with PreserveLoggingContext():