Skip to content

Commit

Permalink
Check file amount when calculating worker count
Browse files Browse the repository at this point in the history
  • Loading branch information
monosans committed Aug 29, 2024
1 parent 5b523a6 commit 19f5a67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion djlint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def main(
echo()

progress_char = " »" if sys.platform == "win32" else "┈━"
worker_count = min(os.cpu_count() or 1, 4)
worker_count = min(os.cpu_count() or 1, len(file_list), 4)
executor_cls = (
ProcessPoolExecutor if worker_count > 1 else ThreadPoolExecutor
)
Expand Down

0 comments on commit 19f5a67

Please sign in to comment.