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.
This commit is contained in:
Luke Hodkinson 2016-10-12 16:32:45 +11:00 committed by Andrew Godwin
parent c419d01ded
commit 1673be5b75

View File

@ -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: