Safe remove of items in exception

This commit is contained in:
James Ketr 2025-03-20 17:58:33 -07:00
parent 1c4d3cee7e
commit 96cd404f5f

View File

@ -771,6 +771,7 @@ class WebServer:
if not session_id in self.sessions:
self.generate_session(ws, session_id)
if ws not in self.sessions[session_id]['sockets']:
self.sessions[session_id]['sockets'].append(ws)
while True:
@ -837,6 +838,7 @@ class WebServer:
self.sessions[session_id]['sockets'].remove(ws)
for socket in self.sessions[session_id]['sockets']:
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
@self.app.route('/')