refac: socket

This commit is contained in:
Timothy Jaeryang Baek 2025-05-09 14:23:16 +04:00
parent d84a3c0bf4
commit ebf5cb22ab

View File

@ -159,6 +159,7 @@ def get_models_in_use():
@sio.on("usage")
async def usage(sid, data):
if sid in SESSION_POOL:
model_id = data["model"]
# Record the timestamp for the last update
current_time = int(time.time())
@ -278,6 +279,7 @@ async def channel_events(sid, data):
@sio.on("user-list")
async def user_list(sid):
if sid in SESSION_POOL:
await sio.emit("user-list", {"user_ids": list(USER_POOL.keys())})