diff --git a/src/program/program.py b/src/program/program.py index 036508f3..d4fb0a43 100644 --- a/src/program/program.py +++ b/src/program/program.py @@ -377,7 +377,8 @@ def _init_db_from_symlinks(self): task = progress.add_task("Enriching items with metadata", total=len(items), log="") with Live(progress, console=console, refresh_per_second=10): - with ThreadPoolExecutor(max_workers=os.getenv("SYMLINK_MAX_WORKERS", 4)) as executor: # testing between 4 and 8 + workers = os.getenv("SYMLINK_MAX_WORKERS", 4) + with ThreadPoolExecutor(max_workers=int(workers)) as executor: future_to_item = {executor.submit(self._enhance_item, item): item for item in items if isinstance(item, (Movie, Show))} for future in as_completed(future_to_item): item = future_to_item[future]