mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Update comment
This commit is contained in:
parent
f5bb1531b7
commit
ffeafade48
@ -627,8 +627,10 @@ def make_deferred_yieldable(deferred):
|
|||||||
(This is more-or-less the opposite operation to run_in_background.)
|
(This is more-or-less the opposite operation to run_in_background.)
|
||||||
"""
|
"""
|
||||||
if inspect.isawaitable(deferred):
|
if inspect.isawaitable(deferred):
|
||||||
# If we're given a coroutine we need to convert it to a deferred so that
|
# If we're given a coroutine we convert it to a deferred so that we
|
||||||
# we can attach callbacks (and not immediately return).
|
# 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)
|
deferred = defer.ensureDeferred(deferred)
|
||||||
|
|
||||||
if not isinstance(deferred, defer.Deferred):
|
if not isinstance(deferred, defer.Deferred):
|
||||||
|
Loading…
Reference in New Issue
Block a user