mirror of
https://git.mirrors.martin98.com/https://github.com/open-webui/open-webui
synced 2025-08-17 11:05:53 +08:00
refac: socket
This commit is contained in:
parent
d84a3c0bf4
commit
ebf5cb22ab
@ -159,6 +159,7 @@ def get_models_in_use():
|
|||||||
|
|
||||||
@sio.on("usage")
|
@sio.on("usage")
|
||||||
async def usage(sid, data):
|
async def usage(sid, data):
|
||||||
|
if sid in SESSION_POOL:
|
||||||
model_id = data["model"]
|
model_id = data["model"]
|
||||||
# Record the timestamp for the last update
|
# Record the timestamp for the last update
|
||||||
current_time = int(time.time())
|
current_time = int(time.time())
|
||||||
@ -278,6 +279,7 @@ async def channel_events(sid, data):
|
|||||||
|
|
||||||
@sio.on("user-list")
|
@sio.on("user-list")
|
||||||
async def user_list(sid):
|
async def user_list(sid):
|
||||||
|
if sid in SESSION_POOL:
|
||||||
await sio.emit("user-list", {"user_ids": list(USER_POOL.keys())})
|
await sio.emit("user-list", {"user_ids": list(USER_POOL.keys())})
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user