From 1cf8e1720d66410b9029a23dc3d784a5d1bc7fd7 Mon Sep 17 00:00:00 2001 From: mungai-njoroge Date: Fri, 12 Jan 2024 08:22:23 +0300 Subject: [PATCH] fix cpu_count less than 2 error --- app/lib/populate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/lib/populate.py b/app/lib/populate.py index ade38c77..d5bb4fce 100644 --- a/app/lib/populate.py +++ b/app/lib/populate.py @@ -238,7 +238,8 @@ def get_image(_map: tuple[str, Album]): pass -CPU_COUNT = os.cpu_count() // 2 +_cpu_count = os.cpu_count() +CPU_COUNT = _cpu_count // 2 if _cpu_count > 2 else _cpu_count class ProcessTrackThumbnails: