diff --git a/device-deps-regenerator/app.py b/device-deps-regenerator/app.py index e08a29a..3a7ae00 100644 --- a/device-deps-regenerator/app.py +++ b/device-deps-regenerator/app.py @@ -1,3 +1,4 @@ +import argparse import concurrent.futures import github import json @@ -6,6 +7,10 @@ import traceback from github import Github from base64 import b64decode +parser = argparse.ArgumentParser() +parser.add_argument('-j', '--jobs', type=int, help='Max number of workers to use. Default is none') +args = parser.parse_args() + with open('token') as f: g = Github(f.readline().strip(), per_page=200) @@ -65,8 +70,7 @@ n = 1 dependencies = {} other_repos = set() - -with concurrent.futures.ThreadPoolExecutor() as executor: +with concurrent.futures.ThreadPoolExecutor(max_workers=args.jobs) as executor: for repo in g.get_organization('LineageOS').get_repos(): if '_device_' not in repo.name: continue