support chat v3 switch to redis
This commit is contained in:
SDE
2023-08-14 17:14:20 +03:00
parent 12213d83c4
commit 11cfcda4fb
3 changed files with 25 additions and 23 deletions

View File

@@ -436,7 +436,9 @@ def create_ticket_ajax(request):
group_name = 'support_managers'
Dict = {
'type': 'update_chat',
'tickets_wo_manager_html': tickets_wo_manager_html
'tickets_wo_manager_html': tickets_wo_manager_html,
'required_beep': True,
'group_name': group_name,
}
channel_layer = get_channel_layer()
async_to_sync(channel_layer.group_send)(

View File

@@ -63,7 +63,7 @@ class ChatConsumer(WebsocketConsumer):
)
group_name = f'user_{receiver}'
if group_name in self.channel_layer.groups.keys():
# if group_name in self.channel_layer.groups.keys():
data.update({
'cur_user': receiver,
'required_beep': True,

View File

@@ -93,11 +93,11 @@ ASGI_APPLICATION = 'TWB.asgi.application'
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'channels.layers.InMemoryChannelLayer'
# "BACKEND": "channels_redis.core.RedisChannelLayer",
# "CONFIG": {
# "hosts": [("127.0.0.1", 6379)],
# },
# 'BACKEND': 'channels.layers.InMemoryChannelLayer',
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": [("127.0.0.1", 6379)],
},
}
}