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 f1894a6..7d3f5f8 100644 --- a/wlm_server/operation/views.py +++ b/wlm_server/operation/views.py @@ -37,7 +37,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: @@ -48,7 +48,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 util.is_wlm_running(): message = MessageInfo(ActionType.CLOSE, None, None)