From 3faa736a0537a62186581c5b227f32d1bef3b88d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Mon, 5 Oct 2020 07:40:16 +0200 Subject: [PATCH] Limit worker number (close #162) --- CB/Core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CB/Core.py b/CB/Core.py index d5a2417..b902d91 100644 --- a/CB/Core.py +++ b/CB/Core.py @@ -324,7 +324,7 @@ def bulk_check_checksum_callback(self, result): self.checksumCache[result[0]] = result[1] def bulk_check_checksum(self, addons, pbar): - with Pool() as pool: + with Pool(processes=min(60, os.cpu_count() or 1)) as pool: workers = [] for addon in addons: w = pool.apply_async(self.check_checksum, (addon, ), callback=self.bulk_check_checksum_callback)