Skip to content

Commit

Permalink
chore: use header to disable nginx buffering
Browse files Browse the repository at this point in the history
  • Loading branch information
skoob13 committed Oct 30, 2024
1 parent 84db60b commit 0fd006d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion posthog/api/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ def generate():
{"prompt": human_message.content, "response": last_message},
)

return StreamingHttpResponse(generate(), content_type=ServerSentEventRenderer.media_type)
return StreamingHttpResponse(
generate(), content_type=ServerSentEventRenderer.media_type, headers={"X-Accel-Buffering": "no"}
)

def handle_column_ch_error(self, error):
if getattr(error, "message", None):
Expand Down

0 comments on commit 0fd006d

Please sign in to comment.