mirror of
https://github.com/django/daphne.git
synced 2024-11-22 07:56:34 +03:00
Tweak idle delays for better performance
This commit is contained in:
parent
fff69f64a7
commit
eaa762c9e3
|
@ -27,14 +27,14 @@ class Server(object):
|
|||
Run in a separate thread; reads messages from the backend.
|
||||
"""
|
||||
channels = self.factory.reply_channels()
|
||||
delay = 0.3
|
||||
delay = 0.05
|
||||
# Quit if reactor is stopping
|
||||
if not reactor.running:
|
||||
logging.debug("Backend reader quitting due to reactor stop")
|
||||
return
|
||||
# Don't do anything if there's no channels to listen on
|
||||
if channels:
|
||||
delay = 0.05
|
||||
delay = 0.01
|
||||
channel, message = self.channel_layer.receive_many(channels, block=False)
|
||||
if channel:
|
||||
delay = 0
|
||||
|
|
Loading…
Reference in New Issue
Block a user