feat: add TTLCache for get_cache_version and TEMPLATE_AUTO_RELOAD config with Makefile worker count variables

This commit is contained in:
2026-06-14 14:46:36 +00:00
parent c151325916
commit d75d5dc6a8
149 changed files with 9811 additions and 262 deletions
+2 -8
View File
@@ -23,6 +23,7 @@ from devplacepy.database import (
get_follow_list,
get_following_among,
get_user_media,
search_users_by_username,
)
from devplacepy.content import can_view_project, enrich_items
from devplacepy.utils import (
@@ -56,14 +57,7 @@ async def search_users(request: Request, q: str = ""):
require_user_api(request)
if not q or len(q) < 1:
return JSONResponse({"results": []})
if "users" in db.tables:
rows = db.query(
"SELECT uid, username FROM users WHERE username LIKE :q LIMIT 10",
q=f"%{q}%",
)
results = [{"uid": r["uid"], "username": r["username"]} for r in rows]
else:
results = []
results = search_users_by_username(q)
return JSONResponse({"results": results})