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):
"room": room,
"proxy": dict(),
"client": dict(),
"thread": dict(),
"forwarder": dict(),
"request": self.make_coco_request()
}
......@@ -151,7 +152,7 @@ class ProxyNamespace(BaseNamespace):
self.clients[request.sid]["forwarder"][connection] = ProxyServer(
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,
asset, system_user
)
......@@ -231,6 +232,9 @@ class ProxyNamespace(BaseNamespace):
del self.clients[request.sid]["forwarder"][connection]
if connection in self.clients[request.sid]["client"].keys():
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:
......
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