diff options
author | Erik Johnston <erik@matrix.org> | 2015-05-08 16:32:18 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-05-08 16:32:18 +0100 |
commit | 476899295f5fd6cff64799bcbc84cd4bf9005e33 (patch) | |
tree | cacce7f0de3c1b694cce8c805c21c297cfbdeb76 /synapse/util/async.py | |
parent | Merge branch 'master' of github.com:matrix-org/synapse into develop (diff) | |
download | synapse-476899295f5fd6cff64799bcbc84cd4bf9005e33.tar.xz |
Change the way we do logging contexts so that they survive divergences
Diffstat (limited to 'synapse/util/async.py')
-rw-r--r-- | synapse/util/async.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/synapse/util/async.py b/synapse/util/async.py index d8febdb90c..f78395a431 100644 --- a/synapse/util/async.py +++ b/synapse/util/async.py @@ -16,15 +16,13 @@ from twisted.internet import defer, reactor -from .logcontext import PreserveLoggingContext +from .logcontext import preserve_context_over_deferred -@defer.inlineCallbacks def sleep(seconds): d = defer.Deferred() reactor.callLater(seconds, d.callback, seconds) - with PreserveLoggingContext(): - yield d + return preserve_context_over_deferred(d) def run_on_reactor(): |