Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

profile_request: Support only synchronous responses for now.

Anders Kaseorg32a8151ce877
diff --git a/zilencer/management/commands/profile_request.py b/zilencer/management/commands/profile_request.py
index edb7064494f..2a2df0ac1e7 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