mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-01-13 06:29:25 -05:00
Fix fixme in preserve_fn
`preserve_fn` is no longer used as a decorator anywhere, so we can safely fix a fixme therein.
This commit is contained in:
parent
773e1c6d68
commit
e2eebf1696
@ -334,12 +334,8 @@ def preserve_fn(f):
|
|||||||
LoggingContext.set_current_context(LoggingContext.sentinel)
|
LoggingContext.set_current_context(LoggingContext.sentinel)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
# XXX: why is this here rather than inside g? surely we want to preserve
|
|
||||||
# the context from the time the function was called, not when it was
|
|
||||||
# wrapped?
|
|
||||||
current = LoggingContext.current_context()
|
|
||||||
|
|
||||||
def g(*args, **kwargs):
|
def g(*args, **kwargs):
|
||||||
|
current = LoggingContext.current_context()
|
||||||
res = f(*args, **kwargs)
|
res = f(*args, **kwargs)
|
||||||
if isinstance(res, defer.Deferred) and not res.called:
|
if isinstance(res, defer.Deferred) and not res.called:
|
||||||
# The function will have reset the context before returning, so
|
# The function will have reset the context before returning, so
|
||||||
|
Loading…
Reference in New Issue
Block a user