summary refs log tree commit diff
path: root/synapse/util/debug.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/debug.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/debug.py')
-rw-r--r--synapse/util/debug.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/synapse/util/debug.py b/synapse/util/debug.py
index f6a5a841a4..b2bee7958f 100644
--- a/synapse/util/debug.py
+++ b/synapse/util/debug.py
@@ -30,8 +30,7 @@ def debug_deferreds():
         context = LoggingContext.current_context()
 
         def restore_context_callback(x):
-            with PreserveLoggingContext():
-                LoggingContext.thread_local.current_context = context
+            with PreserveLoggingContext(context):
                 return fn(x)
 
         return restore_context_callback