From 1673be5b75ddf1f2b6de5687c7de85a4d20ffcb2 Mon Sep 17 00:00:00 2001 From: Luke Hodkinson Date: Wed, 12 Oct 2016 16:32:45 +1100 Subject: [PATCH] Found a bug whereby streaming responses would try to be cached (#396) entirely in memory. Was causing views that stream a lot of data to timeout. --- channels/handler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/channels/handler.py b/channels/handler.py index 62922bf..1eab20c 100644 --- a/channels/handler.py +++ b/channels/handler.py @@ -340,7 +340,9 @@ class ViewConsumer(object): # a whole worker if the client just vanishes and leaves the response # channel full. try: - message.reply_channel.send(reply_message) + # Note: Use immediately to prevent streaming responses trying + # cache all data. + message.reply_channel.send(reply_message, immediately=True) except message.channel_layer.ChannelFull: time.sleep(0.05) else: