summary refs log tree commit diff
path: root/synapse/util/debug.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-12-03 21:03:01 +0000
committerMark Haines <mark.haines@matrix.org>2015-12-03 21:03:01 +0000
commit48a2526d629fc33207cf864de36f3cff706a1c4c (patch)
treeea842b015eeab9a87ec51df74ea6f982d629ca59 /synapse/util/debug.py
parentMerge pull request #414 from matrix-org/erikj/if_not_exists (diff)
downloadsynapse-48a2526d629fc33207cf864de36f3cff706a1c4c.tar.xz
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