Merge pull request #7474 from wizrds/bugfix-emc

Fix bug in API Server WebSocket
This commit is contained in:
Matthias 2022-09-26 10:45:44 +02:00 committed by GitHub
commit cde1d1c2b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,7 +140,7 @@ class ChannelManager:
Disconnect all Channels
"""
with self._lock:
for websocket, channel in self.channels.items():
for websocket, channel in self.channels.copy().items():
if not channel.is_closed():
await channel.close()
@ -154,7 +154,7 @@ class ChannelManager:
"""
with self._lock:
message_type = data.get('type')
for websocket, channel in self.channels.items():
for websocket, channel in self.channels.copy().items():
try:
if channel.subscribed_to(message_type):
await channel.send(data)