diff options
author | Erik Johnston <erik@matrix.org> | 2019-12-10 13:17:39 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-12-10 13:17:39 +0000 |
commit | ffeafade4879a1135ab6795d4ba0c11131f82f01 (patch) | |
tree | 047d9e7928680d9e0f640764a9ff2a10f8383015 /synapse/logging | |
parent | Newsfile (diff) | |
download | synapse-ffeafade4879a1135ab6795d4ba0c11131f82f01.tar.xz |
Update comment
Diffstat (limited to 'synapse/logging')
-rw-r--r-- | synapse/logging/context.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/logging/context.py b/synapse/logging/context.py index 9f484ce59e..6747f29e6a 100644 --- a/synapse/logging/context.py +++ b/synapse/logging/context.py @@ -627,8 +627,10 @@ def make_deferred_yieldable(deferred): (This is more-or-less the opposite operation to run_in_background.) """ if inspect.isawaitable(deferred): - # If we're given a coroutine we need to convert it to a deferred so that - # we can attach callbacks (and not immediately return). + # If we're given a coroutine we convert it to a deferred so that we + # run it and find out if it immediately finishes, it it does then we + # don't need to fiddle with log contexts at all and can return + # immediately. deferred = defer.ensureDeferred(deferred) if not isinstance(deferred, defer.Deferred): |