Remove the non-functional WEB pool size admin control
Setting it only rebound main.py's own module-level WEB_POOL_SIZE - runtime.py and maintenance.py each imported their own copy at process start (from config import WEB_POOL_SIZE), so the actual pool-sizing logic in ensure_web_pool()/cleanup_loop never saw the change and kept targeting the .env value. The UI control only ever changed what the admin page displayed back to itself, plus a couple of >0/<=0 branch checks in main.py - never the real pool. Removed the input, button, JS handler and the dead endpoint rather than wiring the three-module sync it would take to make it actually work. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
-12
@@ -1444,8 +1444,6 @@ def admin_page(request: Request, admin: User = Depends(require_admin), db: Sessi
|
||||
"pool_status": pool_status,
|
||||
"service_health": service_health,
|
||||
"web_totals": web_totals,
|
||||
"web_pool_size": WEB_POOL_SIZE,
|
||||
"web_pool_buffer": WEB_POOL_BUFFER,
|
||||
"recent_sessions": recent_sessions,
|
||||
"open_stats": open_stats,
|
||||
"online_sessions": online_sessions,
|
||||
@@ -3112,16 +3110,6 @@ def delete_category(category_id: int, request: Request, _: User = Depends(requir
|
||||
return {"ok": True}
|
||||
|
||||
|
||||
@app.put("/api/admin/web-pool-size")
|
||||
def update_web_pool_size(payload: dict, request: Request, _: User = Depends(require_admin)):
|
||||
validate_csrf(request)
|
||||
global WEB_POOL_SIZE
|
||||
value = max(0, int(payload.get("size", WEB_POOL_SIZE)))
|
||||
WEB_POOL_SIZE = value
|
||||
ensure_web_pool()
|
||||
return {"ok": True, "size": WEB_POOL_SIZE, "pool": get_web_pool_status()}
|
||||
|
||||
|
||||
@app.post("/api/admin/users")
|
||||
def create_user(payload: dict, request: Request, _: User = Depends(require_admin), db: Session = Depends(get_db)):
|
||||
"""The password is never typed by the admin - it's generated here and
|
||||
|
||||
Reference in New Issue
Block a user