Send message to group from server on production by channels.

33 views
Skip to first unread message

Петр Гордеев

unread,
Jun 15, 2017, 8:14:38 AM6/15/17
to Django users

Hi,
I have a problem with send message from backend on production.
If I want to send message to group through socket, everything is ok.
But if I want to send message from backend (cron, on create object signal), message is not delivered.
On localhost mode both sides work fine.

Ubuntu 14.04. 
Django==1.10.2
channels==1.1.3
daphne==1.2.0
Twisted==16.4.1
asgi-redis==1.4.0

My supervisor conf.

[program:sgl_channels_worker]
stdout_logfile=/var/log/celery/sgl_channels_worker.log
stderr_logfile=/var/log/celery/sgl_channels_worker.log
logfile_maxbytes=50MB
logfile_backups=10
loglevel=error
user=cyber
directory=/home/cyber/backend/src
command=/home/cyber/backend/bin/python manage.py runworker
environment=PATH="/home/cyber/backend/bin",LANG="ru_RU.UTF-8",LC_ALL="ru_RU.UTF-8"


[program:sgl_channels_interface]
stdout_logfile=/var/log/celery/sgl_channels_interface.log
stderr_logfile=/var/log/celery/sgl_channels_interface.log
logfile_maxbytes=50MB
logfile_backups=10
loglevel=error
user=cyber
directory=/home/cyber/backend/src
command=/home/cyber/backend/bin/daphne cyber.asgi:channel_layer -p 8001 -b 176.9.112.200
environment=PATH="/home/cyber/backend/bin",LANG="ru_RU.UTF-8",LC_ALL="ru_RU.UTF-8"

Andrew Godwin

unread,
Jun 15, 2017, 11:01:45 PM6/15/17
to django...@googlegroups.com
What is your CHANNEL_LAYERS configuration? It sounds like the thing running the cron is not on the same layer as everything else.

Andrew

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/65087a45-ee65-4cf6-b065-2d4c14e70e2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages