diff options
author | Erik Johnston <erik@matrix.org> | 2014-11-14 11:46:07 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-11-14 11:46:07 +0000 |
commit | b8eca1ffbf697b968acd0e3abc0341ca134dc6a0 (patch) | |
tree | 64b1eb1540f1eff147fb58ac9e85fc64920a49ad /synapse/util/async.py | |
parent | Use modelService to access room member power levels rather than RoomController. (diff) | |
parent | Merge branch 'develop' into request_logging (diff) | |
download | synapse-b8eca1ffbf697b968acd0e3abc0341ca134dc6a0.tar.xz |
Merge pull request #13 from matrix-org/request_logging
Request logging
Diffstat (limited to 'synapse/util/async.py')
-rw-r--r-- | synapse/util/async.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/util/async.py b/synapse/util/async.py index bf578f8bfb..1219d927db 100644 --- a/synapse/util/async.py +++ b/synapse/util/async.py @@ -16,15 +16,17 @@ 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 def run_on_reactor(): """ This will cause the rest of the function to be invoked upon the next iteration of the main loop """ - return sleep(0) \ No newline at end of file + return sleep(0) |