Safe remove of items in exception
This commit is contained in:
parent
1c4d3cee7e
commit
96cd404f5f
@ -771,6 +771,7 @@ class WebServer:
|
|||||||
if not session_id in self.sessions:
|
if not session_id in self.sessions:
|
||||||
self.generate_session(ws, session_id)
|
self.generate_session(ws, session_id)
|
||||||
|
|
||||||
|
if ws not in self.sessions[session_id]['sockets']:
|
||||||
self.sessions[session_id]['sockets'].append(ws)
|
self.sessions[session_id]['sockets'].append(ws)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
@ -837,6 +838,7 @@ class WebServer:
|
|||||||
self.sessions[session_id]['sockets'].remove(ws)
|
self.sessions[session_id]['sockets'].remove(ws)
|
||||||
for socket in self.sessions[session_id]['sockets']:
|
for socket in self.sessions[session_id]['sockets']:
|
||||||
socket.send(json.dumps({"type": "users", "update": self.sessions[session_id]['users']}))
|
socket.send(json.dumps({"type": "users", "update": self.sessions[session_id]['users']}))
|
||||||
|
return
|
||||||
|
|
||||||
# Serve React app - This catches all routes not matched by API endpoints
|
# Serve React app - This catches all routes not matched by API endpoints
|
||||||
@self.app.route('/')
|
@self.app.route('/')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user