From 26ef19f4c6c3abee2a076bdc8744cad02df87493 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 15 Jun 2026 02:17:01 +0200 Subject: [PATCH] Clear query locks during library purge and deletion --- backend/local_rag.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/local_rag.py b/backend/local_rag.py index d6039c6..1fc9817 100644 --- a/backend/local_rag.py +++ b/backend/local_rag.py @@ -1277,6 +1277,7 @@ def purge_libraries(): LIB_ROOT.mkdir(parents=True, exist_ok=True) JOBS.clear() LIB_LOCKS.clear() + QUERY_LOCKS.clear() if failures: preview = "; ".join(failures[:3]) @@ -1310,6 +1311,8 @@ def delete_library(slug: str): if not path.exists(): raise HTTPException(status_code=404, detail="Library not found") shutil.rmtree(path) + LIB_LOCKS.pop(slug, None) + QUERY_LOCKS.pop(slug, None) return {"ok": True}