mirror of
https://github.com/django/daphne.git
synced 2025-07-10 16:02: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()
|
channels = self.channel_layer.registry.all_channel_names()
|
||||||
while True:
|
while True:
|
||||||
channel, content = self.channel_layer.receive_many(channels, block=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 no message, stall a little to avoid busy-looping then continue
|
||||||
if channel is None:
|
if channel is None:
|
||||||
time.sleep(0.01)
|
time.sleep(0.01)
|
||||||
continue
|
continue
|
||||||
# Create message wrapper
|
# Create message wrapper
|
||||||
|
logger.debug("Worker got message on %s: repl %s", channel, content.get("reply_channel", "none"))
|
||||||
message = Message(
|
message = Message(
|
||||||
content=content,
|
content=content,
|
||||||
channel_name=channel,
|
channel_name=channel,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user