mirror of
https://github.com/open-webui/open-webui
synced 2025-01-29 13:58:09 +00:00
refac: remove prints
This commit is contained in:
parent
d5b595a842
commit
0b30dc357c
@ -39,7 +39,7 @@ async def connect(sid, environ, auth):
|
|||||||
else:
|
else:
|
||||||
USER_POOL[user.id] = [sid]
|
USER_POOL[user.id] = [sid]
|
||||||
|
|
||||||
print(f"user {user.name}({user.id}) connected with session ID {sid}")
|
# print(f"user {user.name}({user.id}) connected with session ID {sid}")
|
||||||
|
|
||||||
await sio.emit("user-count", {"count": len(set(USER_POOL))})
|
await sio.emit("user-count", {"count": len(set(USER_POOL))})
|
||||||
await sio.emit("usage", {"models": get_models_in_use()})
|
await sio.emit("usage", {"models": get_models_in_use()})
|
||||||
@ -47,7 +47,7 @@ async def connect(sid, environ, auth):
|
|||||||
|
|
||||||
@sio.on("user-join")
|
@sio.on("user-join")
|
||||||
async def user_join(sid, data):
|
async def user_join(sid, data):
|
||||||
print("user-join", sid, data)
|
# print("user-join", sid, data)
|
||||||
|
|
||||||
auth = data["auth"] if "auth" in data else None
|
auth = data["auth"] if "auth" in data else None
|
||||||
if not auth or "token" not in auth:
|
if not auth or "token" not in auth:
|
||||||
@ -67,7 +67,7 @@ async def user_join(sid, data):
|
|||||||
else:
|
else:
|
||||||
USER_POOL[user.id] = [sid]
|
USER_POOL[user.id] = [sid]
|
||||||
|
|
||||||
print(f"user {user.name}({user.id}) connected with session ID {sid}")
|
# print(f"user {user.name}({user.id}) connected with session ID {sid}")
|
||||||
|
|
||||||
await sio.emit("user-count", {"count": len(set(USER_POOL))})
|
await sio.emit("user-count", {"count": len(set(USER_POOL))})
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ async def remove_after_timeout(sid, model_id):
|
|||||||
try:
|
try:
|
||||||
await asyncio.sleep(TIMEOUT_DURATION)
|
await asyncio.sleep(TIMEOUT_DURATION)
|
||||||
if model_id in USAGE_POOL:
|
if model_id in USAGE_POOL:
|
||||||
print(USAGE_POOL[model_id]["sids"])
|
# print(USAGE_POOL[model_id]["sids"])
|
||||||
USAGE_POOL[model_id]["sids"].remove(sid)
|
USAGE_POOL[model_id]["sids"].remove(sid)
|
||||||
USAGE_POOL[model_id]["sids"] = list(set(USAGE_POOL[model_id]["sids"]))
|
USAGE_POOL[model_id]["sids"] = list(set(USAGE_POOL[model_id]["sids"]))
|
||||||
|
|
||||||
@ -143,7 +143,8 @@ async def disconnect(sid):
|
|||||||
|
|
||||||
await sio.emit("user-count", {"count": len(USER_POOL)})
|
await sio.emit("user-count", {"count": len(USER_POOL)})
|
||||||
else:
|
else:
|
||||||
print(f"Unknown session ID {sid} disconnected")
|
pass
|
||||||
|
# print(f"Unknown session ID {sid} disconnected")
|
||||||
|
|
||||||
|
|
||||||
def get_event_emitter(request_info):
|
def get_event_emitter(request_info):
|
||||||
|
Loading…
Reference in New Issue
Block a user