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
This commit is contained in:
Stephan Kulow 2022-11-04 10:00:28 +01:00
parent 60ced896a3
commit a457a16a50
2 changed files with 3 additions and 3 deletions

View File

@ -113,7 +113,7 @@ def main():
importer = Importer(URL_OBS, "openSUSE:Factory", args.packages) importer = Importer(URL_OBS, "openSUSE:Factory", args.packages)
importer.import_into_db() importer.import_into_db()
with concurrent.futures.ProcessPoolExecutor() as executor: with concurrent.futures.ProcessPoolExecutor(max_workers=8) as executor:
fs = [ fs = [
executor.submit( executor.submit(
export_package, package, args.repodir, args.cachedir, args.gc export_package, package, args.repodir, args.cachedir, args.gc

View File

@ -196,7 +196,7 @@ class Importer:
self.find_linked_revs() self.find_linked_revs()
self.find_fake_revisions() self.find_fake_revisions()
with concurrent.futures.ThreadPoolExecutor() as executor: with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor:
fs = [ fs = [
executor.submit(import_rev, self, rev) executor.submit(import_rev, self, rev)
for rev in self.revisions_without_files() for rev in self.revisions_without_files()
@ -215,7 +215,7 @@ class Importer:
def import_into_db(self): def import_into_db(self):
with concurrent.futures.ThreadPoolExecutor() as executor: with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor:
fs = [ fs = [
executor.submit(refresh_package, self, self.project, package) executor.submit(refresh_package, self, self.project, package)
for package in self.packages for package in self.packages