Commit 4b742525 authored by ibuler's avatar ibuler

[Bugfix] 修复web terminal突然关闭的问题

parent f21329c6
......@@ -184,9 +184,10 @@ class ProxyNamespace(BaseNamespace):
connection = Connection.get_connection(request.sid)
if not connection:
return
for client in connection.clients:
clients_copy = list(connection.clients.keys())
for client_id in clients_copy:
try:
self.on_logout(client.id)
self.on_logout(client_id)
except Exception as e:
logger.warn(e)
Connection.remove_connection(connection.id)
......
......@@ -333,15 +333,11 @@ class WSProxy:
def closed(self):
return self.sock._closed
def session_close(self):
self.ws.on_logout(self.client_id)
def write(self, data):
self.proxy.send(data.encode())
def close(self):
self.proxy.close()
self.sock.close()
def __getattr__(self, item):
return getattr(self.sock, item)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment