From 32a8151ce8779bd100f6aef6e18b3d8e390a82de Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 19 Jul 2023 14:31:19 -0700 Subject: [PATCH] profile_request: Support only synchronous responses for now. Signed-off-by: Anders Kaseorg --- zilencer/management/commands/profile_request.py | 1 + 1 file changed, 1 insertion(+) diff --git a/zilencer/management/commands/profile_request.py b/zilencer/management/commands/profile_request.py index edb7064494..2a2df0ac1e 100644 --- a/zilencer/management/commands/profile_request.py +++ b/zilencer/management/commands/profile_request.py @@ -27,6 +27,7 @@ def profile_request(request: HttpRequest) -> HttpResponseBase: prof = cProfile.Profile() with tempfile.NamedTemporaryFile(prefix="profile.data.", delete=False) as stats_file: response = LogRequests(get_response)(request) + assert isinstance(response, HttpResponseBase) # async responses not supported here for now prof.dump_stats(stats_file.name) logging.info("Profiling data written to %s", stats_file.name) return response