Clear query locks during library purge and deletion

This commit is contained in:
2026-06-15 02:17:01 +02:00
parent 730c6be2cb
commit 26ef19f4c6

View File

@@ -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}