Copy websockets list before iterating over it to prevent race conditions upon list changed upon iteration
This commit is contained in:
parent
387ed23e86
commit
68f985d2c6
1 changed files with 2 additions and 1 deletions
|
@ -204,7 +204,8 @@ class HttpBackend(Backend):
|
|||
|
||||
loop = get_or_create_event_loop()
|
||||
|
||||
for websocket in self.active_websockets:
|
||||
websockets = self.active_websockets.copy()
|
||||
for websocket in websockets:
|
||||
try:
|
||||
loop.run_until_complete(send_event(websocket))
|
||||
except websockets.exceptions.ConnectionClosed:
|
||||
|
|
Loading…
Reference in a new issue