From 19f5a679cb05fb76f3603a93b1aa391aba12baeb Mon Sep 17 00:00:00 2001 From: monosans Date: Thu, 29 Aug 2024 12:56:09 +0300 Subject: [PATCH] Check file amount when calculating worker count --- djlint/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/djlint/__init__.py b/djlint/__init__.py index 6b103fbe8..9eab980b7 100644 --- a/djlint/__init__.py +++ b/djlint/__init__.py @@ -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 )