summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2017-04-03 15:38:02 +0100
committerRichard van der Hoff <richard@matrix.org>2017-04-03 15:38:02 +0100
commite2eebf16963d9580a581a15308d2771dce875a83 (patch)
tree4a8eed714946a29383e4438de59c9e34fef9a55e
parentRemove spurious @preserve_fn decorators (diff)
downloadsynapse-e2eebf16963d9580a581a15308d2771dce875a83.tar.xz
Fix fixme in preserve_fn
`preserve_fn` is no longer used as a decorator anywhere, so we can safely fix a
fixme therein.
Diffstat (limited to '')
-rw-r--r--synapse/util/logcontext.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/synapse/util/logcontext.py b/synapse/util/logcontext.py
index 857afee7cb..990216145e 100644
--- a/synapse/util/logcontext.py
+++ b/synapse/util/logcontext.py
@@ -334,12 +334,8 @@ def preserve_fn(f):
         LoggingContext.set_current_context(LoggingContext.sentinel)
         return result
 
-    # XXX: why is this here rather than inside g? surely we want to preserve
-    # the context from the time the function was called, not when it was
-    # wrapped?
-    current = LoggingContext.current_context()
-
     def g(*args, **kwargs):
+        current = LoggingContext.current_context()
         res = f(*args, **kwargs)
         if isinstance(res, defer.Deferred) and not res.called:
             # The function will have reset the context before returning, so