From e769e546b68a7039ff1592c05b49a2f283259c95 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 4 Nov 2024 12:31:36 -0800 Subject: [PATCH] tornado: Use Signal.asend. Signed-off-by: Anders Kaseorg --- .codespellignore | 1 + zerver/tornado/handlers.py | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.codespellignore b/.codespellignore index e3231908b2..49cfed17ef 100644 --- a/.codespellignore +++ b/.codespellignore @@ -28,3 +28,4 @@ couldn ges assertIn thirdparty +asend diff --git a/zerver/tornado/handlers.py b/zerver/tornado/handlers.py index 5fb27131dd..ac15054bf8 100644 --- a/zerver/tornado/handlers.py +++ b/zerver/tornado/handlers.py @@ -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