Skip to content

Commit

Permalink
Rename group name for notifying operation change
Browse files Browse the repository at this point in the history
See also: #17
  • Loading branch information
BECATRUE committed Dec 3, 2024
1 parent 6e93902 commit 5e87785
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion wlm_server/operation/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions wlm_server/operation/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit 5e87785

Please sign in to comment.