diff options
author | Neil Johnson <neil@fragile.org.uk> | 2018-03-26 14:51:11 +0100 |
---|---|---|
committer | Neil Johnson <neil@fragile.org.uk> | 2018-03-26 14:51:11 +0100 |
commit | aa3587fdd111d01b3bd0a610dab6e102d79f230c (patch) | |
tree | 1fad5548eab845afcb1fe5f0c5e26694b322d6d3 /docs/log_contexts.rst | |
parent | Merge branch 'hotfixes-v0.26.1' of github.com:matrix-org/synapse (diff) | |
parent | version bump (diff) | |
download | synapse-aa3587fdd111d01b3bd0a610dab6e102d79f230c.tar.xz |
Merge branch 'release-v0.27.0' of https://github.com/matrix-org/synapse v0.27.0
Diffstat (limited to 'docs/log_contexts.rst')
-rw-r--r-- | docs/log_contexts.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/log_contexts.rst b/docs/log_contexts.rst index b19b7fa1ea..82ac4f91e5 100644 --- a/docs/log_contexts.rst +++ b/docs/log_contexts.rst @@ -279,9 +279,9 @@ Obviously that option means that the operations done in that might be fixed by setting a different logcontext via a ``with LoggingContext(...)`` in ``background_operation``). -The second option is to use ``logcontext.preserve_fn``, which wraps a function -so that it doesn't reset the logcontext even when it returns an incomplete -deferred, and adds a callback to the returned deferred to reset the +The second option is to use ``logcontext.run_in_background``, which wraps a +function so that it doesn't reset the logcontext even when it returns an +incomplete deferred, and adds a callback to the returned deferred to reset the logcontext. In other words, it turns a function that follows the Synapse rules about logcontexts and Deferreds into one which behaves more like an external function — the opposite operation to that described in the previous section. @@ -293,7 +293,7 @@ It can be used like this: def do_request_handling(): yield foreground_operation() - logcontext.preserve_fn(background_operation)() + logcontext.run_in_background(background_operation) # this will now be logged against the request context logger.debug("Request handling complete") |