Convert run_as_background_process inner function to async. (#8032)

This commit is contained in:
Patrick Cloke 2020-08-06 08:20:42 -04:00 committed by GitHub
parent 66f24449dd
commit c36228c403
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 26 deletions

View file

@ -146,10 +146,9 @@ class SynapseRequest(Request):
Returns a context manager; the correct way to use this is:
@defer.inlineCallbacks
def handle_request(request):
async def handle_request(request):
with request.processing("FooServlet"):
yield really_handle_the_request()
await really_handle_the_request()
Once the context manager is closed, the completion of the request will be logged,
and the various metrics will be updated.