Prevent Quart from cancelling active chat streams after 60 seconds

This commit is contained in:
2026-10-12 19:38:04 -04:00
parent 4ce254193e
commit 2cb131bbd2
2 changed files with 23 additions and 2 deletions
+5 -1
View File
@@ -619,7 +619,7 @@ async def stream_query():
_log_summary()
yield "data: [DONE]\n\n"
return await make_response(
response = await make_response(
event_generator(),
200,
{
@@ -628,6 +628,10 @@ async def stream_query():
"X-Accel-Buffering": "no",
},
)
# Quart's default 60s response deadline cancels even active SSE streams.
# Silent model calls are bounded separately by MODEL_STALL_TIMEOUT.
response.timeout = None
return response
@conversation_blueprint.route("/<conversation_id>")