refac: remove prints

This commit is contained in:
Timothy J. Baek 2024-09-12 09:13:21 -04:00
parent d5b595a842
commit 0b30dc357c

View File

@ -39,7 +39,7 @@ async def connect(sid, environ, auth):
else:
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("usage", {"models": get_models_in_use()})
@ -47,7 +47,7 @@ async def connect(sid, environ, auth):
@sio.on("user-join")
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
if not auth or "token" not in auth:
@ -67,7 +67,7 @@ async def user_join(sid, data):
else:
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))})
@ -116,7 +116,7 @@ async def remove_after_timeout(sid, model_id):
try:
await asyncio.sleep(TIMEOUT_DURATION)
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"] = list(set(USAGE_POOL[model_id]["sids"]))
@ -143,7 +143,8 @@ async def disconnect(sid):
await sio.emit("user-count", {"count": len(USER_POOL)})
else:
print(f"Unknown session ID {sid} disconnected")
pass
# print(f"Unknown session ID {sid} disconnected")
def get_event_emitter(request_info):