From ae10620897f1e1b64c3af64ade3a5c23754130e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Kadl=C4=8D=C3=ADk?= Date: Mon, 22 May 2017 20:02:13 +0200 Subject: [PATCH] Allow to set NUM_CONSECUTIVE_BUILDS to 0 as infinite Thank you @jkaluza for this piece of code --- module_build_service/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module_build_service/utils.py b/module_build_service/utils.py index 810d24fa..020c1ed0 100644 --- a/module_build_service/utils.py +++ b/module_build_service/utils.py @@ -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)