From a457a16a50475a64da4bc689f5382fb42033bff0 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Fri, 4 Nov 2022 10:00:28 +0100 Subject: [PATCH] Limit the workers to 8 This is hard coding the limit, we may want to make this configurable but for now the machines supposed to run this code are very similiar --- git-importer.py | 2 +- lib/importer.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/git-importer.py b/git-importer.py index 6b030d6..2948efb 100755 --- a/git-importer.py +++ b/git-importer.py @@ -113,7 +113,7 @@ def main(): importer = Importer(URL_OBS, "openSUSE:Factory", args.packages) importer.import_into_db() - with concurrent.futures.ProcessPoolExecutor() as executor: + with concurrent.futures.ProcessPoolExecutor(max_workers=8) as executor: fs = [ executor.submit( export_package, package, args.repodir, args.cachedir, args.gc diff --git a/lib/importer.py b/lib/importer.py index 031d1eb..5cd3062 100644 --- a/lib/importer.py +++ b/lib/importer.py @@ -196,7 +196,7 @@ class Importer: self.find_linked_revs() self.find_fake_revisions() - with concurrent.futures.ThreadPoolExecutor() as executor: + with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor: fs = [ executor.submit(import_rev, self, rev) for rev in self.revisions_without_files() @@ -215,7 +215,7 @@ class Importer: def import_into_db(self): - with concurrent.futures.ThreadPoolExecutor() as executor: + with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor: fs = [ executor.submit(refresh_package, self, self.project, package) for package in self.packages