summary refs log tree commit diff
path: root/synapse/util/async.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/util/async.py')
-rw-r--r--synapse/util/async.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/util/async.py b/synapse/util/async.py
index 647ea6142c..3d3fbe182c 100644
--- a/synapse/util/async.py
+++ b/synapse/util/async.py
@@ -16,8 +16,11 @@
 
 from twisted.internet import defer, reactor
 
+from .logcontext import PreserveLoggingContext
 
+@defer.inlineCallbacks
 def sleep(seconds):
     d = defer.Deferred()
     reactor.callLater(seconds, d.callback, seconds)
-    return d
+    with PreserveLoggingContext():
+        yield d