mirror of
https://github.com/django/daphne.git
synced 2025-07-10 08:02:16 +03:00
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:
parent
c419d01ded
commit
1673be5b75
|
@ -340,7 +340,9 @@ class ViewConsumer(object):
|
||||||
# a whole worker if the client just vanishes and leaves the response
|
# a whole worker if the client just vanishes and leaves the response
|
||||||
# channel full.
|
# channel full.
|
||||||
try:
|
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:
|
except message.channel_layer.ChannelFull:
|
||||||
time.sleep(0.05)
|
time.sleep(0.05)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user