tornado: Use Signal.asend.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-11-04 12:31:36 -08:00
committed by Tim Abbott
parent 1e99745023
commit e769e546b6
2 changed files with 2 additions and 4 deletions

View File

@@ -28,3 +28,4 @@ couldn
ges
assertIn
thirdparty
asend

View File

@@ -132,10 +132,7 @@ class AsyncDjangoHandler(tornado.web.RequestHandler):
# Django's WSGIHandler.__call__ before the call to
# `get_response()`.
set_script_prefix(get_script_name(environ))
await sync_to_async(
lambda: signals.request_started.send(sender=type(self.django_handler)),
thread_sensitive=True,
)()
await signals.request_started.asend(sender=type(self.django_handler))
self._request = WSGIRequest(environ)
# We do the import during runtime to avoid cyclic dependency