Unverified Commit 5a23d925 authored by liuzheng's avatar liuzheng Committed by liuzheng712

feat: update, try to fix the session auto remove

maybe fix the bug
parent 24da12cc
...@@ -64,6 +64,7 @@ class ProxyNamespace(BaseNamespace): ...@@ -64,6 +64,7 @@ class ProxyNamespace(BaseNamespace):
"room": room, "room": room,
"proxy": dict(), "proxy": dict(),
"client": dict(), "client": dict(),
"thread": dict(),
"forwarder": dict(), "forwarder": dict(),
"request": self.make_coco_request() "request": self.make_coco_request()
} }
...@@ -151,7 +152,7 @@ class ProxyNamespace(BaseNamespace): ...@@ -151,7 +152,7 @@ class ProxyNamespace(BaseNamespace):
self.clients[request.sid]["forwarder"][connection] = ProxyServer( self.clients[request.sid]["forwarder"][connection] = ProxyServer(
self.app, self.clients[request.sid]["client"][connection] self.app, self.clients[request.sid]["client"][connection]
) )
self.socketio.start_background_task( self.clients[request.sid]["thread"][connection] = self.socketio.start_background_task(
self.clients[request.sid]["forwarder"][connection].proxy, self.clients[request.sid]["forwarder"][connection].proxy,
asset, system_user asset, system_user
) )
...@@ -231,6 +232,9 @@ class ProxyNamespace(BaseNamespace): ...@@ -231,6 +232,9 @@ class ProxyNamespace(BaseNamespace):
del self.clients[request.sid]["forwarder"][connection] del self.clients[request.sid]["forwarder"][connection]
if connection in self.clients[request.sid]["client"].keys(): if connection in self.clients[request.sid]["client"].keys():
del self.clients[request.sid]["client"][connection] del self.clients[request.sid]["client"][connection]
if connection in self.clients[request.sid]["thread"].keys():
logger.debug("thread close", connection)
self.clients[request.sid]["thread"][connection].stop()
class HttpServer: class HttpServer:
......
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