This commit is contained in:
nose
2025-12-03 15:18:57 -08:00
parent 89aa24961b
commit 5e4df11dbf
12 changed files with 1953 additions and 346 deletions

View File

@@ -88,9 +88,7 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
try:
from helper.local_library import LocalLibraryDB
db: LocalLibraryDB | None = None
try:
db = LocalLibraryDB(library_root)
with LocalLibraryDB(library_root) as db:
if clear_requested:
count = db.clear_finished_workers()
log(f"Cleared {count} finished workers.")
@@ -115,9 +113,6 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
if selection_requested:
return _render_worker_selection(db, result)
return _render_worker_list(db, status_filter, limit)
finally:
if db:
db.close()
except Exception as exc:
log(f"Workers query failed: {exc}", file=sys.stderr)
import traceback