diff options
author | Richard van der Hoff <github@rvanderhoff.org.uk> | 2017-04-03 17:02:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-03 17:02:25 +0100 |
commit | 773e64cc1a381cdd12e8f3dd9a03eae0f34c35a6 (patch) | |
tree | d45818d4976fb63c40652647cc0bf64d9a891111 /synapse/util/logcontext.py | |
parent | Merge remote-tracking branch 'origin/release-v0.20.0' into develop (diff) | |
parent | Remove spurious yield (diff) | |
download | synapse-773e64cc1a381cdd12e8f3dd9a03eae0f34c35a6.tar.xz |
Merge pull request #2095 from matrix-org/rav/cull_log_preserves
Cull spurious PreserveLoggingContexts
Diffstat (limited to 'synapse/util/logcontext.py')
-rw-r--r-- | synapse/util/logcontext.py | 6 |
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 |