websockets: don't alter dictionary during iteration of "view"

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2020-08-04 10:17:05 -04:00
parent 6c69dbdca9
commit e93e4521a4
1 changed files with 1 additions and 1 deletions

View File

@ -178,7 +178,7 @@ class WebsocketManager:
'method': "notify_" + name, 'method': "notify_" + name,
'params': [data]}) 'params': [data]})
async with self.ws_lock: async with self.ws_lock:
for ws in self.websockets.values(): for ws in list(self.websockets.values()):
try: try:
ws.write_message(notification) ws.write_message(notification)
except WebSocketClosedError: except WebSocketClosedError: