enh/refac: deprecate USER_POOL

This commit is contained in:
Timothy Jaeryang Baek
2025-11-28 07:39:02 -05:00
parent c2634d45ad
commit 70948f8803
10 changed files with 50 additions and 88 deletions

View File

@@ -66,7 +66,6 @@ from open_webui.socket.main import (
periodic_usage_pool_cleanup,
get_event_emitter,
get_models_in_use,
get_active_user_ids,
)
from open_webui.routers import (
audio,
@@ -2021,7 +2020,10 @@ async def get_current_usage(user=Depends(get_verified_user)):
This is an experimental endpoint and subject to change.
"""
try:
return {"model_ids": get_models_in_use(), "user_ids": get_active_user_ids()}
return {
"model_ids": get_models_in_use(),
"user_count": Users.get_active_user_count(),
}
except Exception as e:
log.error(f"Error getting usage statistics: {e}")
raise HTTPException(status_code=500, detail="Internal Server Error")