Hello, I am writing chat on django-channels . Faced the problem that after rebooting the server, the old channels are not removed from the group, but new ones are created. Backend: 'asgi_redis.RedisChannelLayer' . How to "kill" all the channels when rebooting, or the old channel, for a user when connecting?
Connect Consumer:
def on_connect(message): Group('chat').add(message.reply_channel) Disconnect Consumer:
def on_disconnect(message): Group('chat').discard(message.reply_channel)