refactor: uv-based deps, no nexus auth, LLM retries, lock cleanup, health checks, e2e tests

This commit is contained in:
Marker689
2026-05-11 19:27:56 +03:00
parent 698f02c8af
commit 04abe44ab4
20 changed files with 1583 additions and 51 deletions

View File

@@ -32,6 +32,19 @@ router = APIRouter(tags=["web"])
_llm_locks: dict[int, asyncio.Lock] = {}
_llm_lock = asyncio.Lock()
# Cleanup interval for unused LLM locks (30 minutes)
_LLM_LOCK_CLEANUP_INTERVAL = 1800
async def _cleanup_llm_locks():
"""Periodically clean up unused LLM locks to prevent memory leaks."""
while True:
await asyncio.sleep(_LLM_LOCK_CLEANUP_INTERVAL)
for key in list(_llm_locks.keys()):
if not _llm_locks[key].locked():
_llm_locks.pop(key, None)
_jinja_env = Environment(
loader=PackageLoader(APP_PACKAGE, "web/templates"),
autoescape=select_autoescape(),