summary refs log tree commit diff
path: root/synapse/util/async.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-05-08 16:32:18 +0100
committerErik Johnston <erik@matrix.org>2015-05-08 16:32:18 +0100
commit476899295f5fd6cff64799bcbc84cd4bf9005e33 (patch)
treecacce7f0de3c1b694cce8c805c21c297cfbdeb76 /synapse/util/async.py
parentMerge branch 'master' of github.com:matrix-org/synapse into develop (diff)
downloadsynapse-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.py6
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():