Skip to content

Commit 6a98096

Browse files
committed
Add potential future simplication of run_as_background_process
1 parent 0e990e6 commit 6a98096

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

synapse/metrics/background_process_metrics.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ async def run() -> Optional[R]:
300300
# `sentinel` context and means the new `BackgroundProcessLoggingContext` will
301301
# remember the `sentinel` context as its previous context to return to when it
302302
# exits and yields control back to the reactor.
303+
#
304+
# TODO: I think we could simplify this whole block by using `return run_in_background(run)`
305+
# which appears to give equivalent behaviour.
303306
with PreserveLoggingContext():
304307
# The async `run` task is wrapped in a deferred, which will have the side effect
305308
# of executing the coroutine.

0 commit comments

Comments
 (0)