Skip to content

Commit

Permalink
Use as_completed() for thread pool
Browse files Browse the repository at this point in the history
  • Loading branch information
henryruhs committed Jun 21, 2023
1 parent efdd77a commit cd96b47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions roop/processors/frame/core.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys
import importlib
from concurrent.futures import ThreadPoolExecutor
from concurrent.futures import ThreadPoolExecutor, as_completed
from types import ModuleType
from typing import Any, List, Callable
from tqdm import tqdm
Expand Down Expand Up @@ -44,7 +44,7 @@ def multi_process_frame(source_path: str, temp_frame_paths: List[str], process_f
for path in temp_frame_paths:
future = executor.submit(process_frames, source_path, [path], progress)
futures.append(future)
for future in futures:
for future in as_completed(futures):
future.result()


Expand Down

0 comments on commit cd96b47

Please sign in to comment.