Allow to set NUM_CONSECUTIVE_BUILDS to 0 as infinite

Thank you @jkaluza for this piece of code
This commit is contained in:
Jakub Kadlčík
2017-05-22 20:02:13 +02:00
parent 3817914963
commit ae10620897

View File

@@ -174,7 +174,10 @@ def continue_batch_build(config, module, session, builder, components=None):
components_to_build.append(c)
# Start build of components in this batch.
with concurrent.futures.ThreadPoolExecutor(max_workers=config.num_consecutive_builds) as executor:
max_workers = 1
if config.num_consecutive_builds > 0:
max_workers = config.num_consecutive_builds
with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
futures = {executor.submit(start_build_component, builder, c): c for c in components_to_build}
concurrent.futures.wait(futures)