mirror of
https://github.com/django/daphne.git
synced 2025-04-20 08:42:18 +03:00
Fix core logging when no message on channel
This commit is contained in:
parent
93d1aa9b74
commit
d18c715f8f
|
@ -26,12 +26,12 @@ class Worker(object):
|
|||
channels = self.channel_layer.registry.all_channel_names()
|
||||
while True:
|
||||
channel, content = self.channel_layer.receive_many(channels, block=True)
|
||||
logger.debug("Worker got message on %s: repl %s", channel, content.get("reply_channel", "none"))
|
||||
# If no message, stall a little to avoid busy-looping then continue
|
||||
if channel is None:
|
||||
time.sleep(0.01)
|
||||
continue
|
||||
# Create message wrapper
|
||||
logger.debug("Worker got message on %s: repl %s", channel, content.get("reply_channel", "none"))
|
||||
message = Message(
|
||||
content=content,
|
||||
channel_name=channel,
|
||||
|
|
Loading…
Reference in New Issue
Block a user