diff --git a/wlm_server/operation/consumers.py b/wlm_server/operation/consumers.py index 6b746dd..19f3c5f 100644 --- a/wlm_server/operation/consumers.py +++ b/wlm_server/operation/consumers.py @@ -11,7 +11,7 @@ class OperationConsumer(AsyncWebsocketConsumer): # pylint: disable=attribute-defined-outside-init async def connect(self): self.ch = self.scope['url_route']['kwargs']['ch'] - self.group_name = f'channel_{self.ch}' + self.group_name = f'channel_{self.ch}_operation' await self.channel_layer.group_add(self.group_name, self.channel_name) await self.accept() diff --git a/wlm_server/operation/views.py b/wlm_server/operation/views.py index 9fade59..f0649ad 100644 --- a/wlm_server/operation/views.py +++ b/wlm_server/operation/views.py @@ -54,7 +54,7 @@ def handle_info(request, ch: int): notif = {'on': True} channel_layer = get_channel_layer() async_to_sync(channel_layer.group_send)( - f'channel_{ch}', {'type': 'notify', 'message': json.dumps(notif)} + f'channel_{ch}_operation', {'type': 'notify', 'message': json.dumps(notif)} ) operation.save() else: @@ -66,7 +66,7 @@ def handle_info(request, ch: int): notif = {'on': False} channel_layer = get_channel_layer() async_to_sync(channel_layer.group_send)( - f'channel_{ch}', {'type': 'notify', 'message': json.dumps(notif)} + f'channel_{ch}_operation', {'type': 'notify', 'message': json.dumps(notif)} ) if not is_wlm_running: message = MessageInfo(ActionType.CLOSE, None, None)