From 58c1df912f0dc29f229c5a98419fad82488322f3 Mon Sep 17 00:00:00 2001 From: "David H. Irving" Date: Thu, 29 Aug 2024 13:45:46 -0700 Subject: [PATCH] add x-accel-buffering --- .../remote_butler/server/handlers/_external_query.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python/lsst/daf/butler/remote_butler/server/handlers/_external_query.py b/python/lsst/daf/butler/remote_butler/server/handlers/_external_query.py index 44023eba9a..d08bafd276 100644 --- a/python/lsst/daf/butler/remote_butler/server/handlers/_external_query.py +++ b/python/lsst/daf/butler/remote_butler/server/handlers/_external_query.py @@ -90,7 +90,15 @@ def query_execute( ctx, spec, ) - return StreamingResponse(output_generator, media_type="application/jsonlines") + return StreamingResponse( + output_generator, + media_type="application/jsonlines", + headers={ + # Instruct the Kubernetes ingress to not buffer the response, + # so that keep-alives reach the client promptly. + "X-Accel-Buffering": "no" + }, + ) # Mypy thinks that ExitStack might swallow an exception. assert False, "This line is unreachable."