(20250102) SocketIO on-disconnect bug fixed.

This commit is contained in:
2025-01-02 13:47:44 +00:00
parent 025acdccf1
commit b955b1097b
+2 -2
View File
@@ -462,8 +462,8 @@ async def handle_disconnect(sid, reason) -> None:
# register the disconnect in the global variable, and on the cache server: # register the disconnect in the global variable, and on the cache server:
client_info = {} client_info = {}
async with exclusive_lock: client_info = CONNECTED_CLIENTS.pop(sid) async with exclusive_lock: client_info = CONNECTED_CLIENTS.pop(sid, None)
sid_uncached = await redis_cache.delete(key = client_info["redisKey"]) sid_uncached = await redis_cache.delete(key = client_info["redisKey"]) if client_info else False
printer("SOCKET DISCONNECTED", sid, reason, sid_uncached) printer("SOCKET DISCONNECTED", sid, reason, sid_uncached)