mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 14:24:48 -04:00
Change the way we do logging contexts so that they survive divergences
This commit is contained in:
parent
db0dca2f6f
commit
476899295f
13 changed files with 128 additions and 97 deletions
|
@ -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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue