Merge "Make housekeeping build spares with an executor"

This commit is contained in:
Jenkins
2017-09-19 18:40:07 +00:00
committed by Gerrit Code Review

View File

@@ -50,10 +50,12 @@ class SpareAmphora(object):
LOG.info("Initiating creation of %d spare amphora.", diff_count) LOG.info("Initiating creation of %d spare amphora.", diff_count)
# Call Amphora Create Flow diff_count times # Call Amphora Create Flow diff_count times
for i in range(1, diff_count + 1): with futures.ThreadPoolExecutor(
LOG.debug("Starting amphorae number %d ...", i) max_workers=CONF.house_keeping.spare_amphora_pool_size
self.cw.create_amphora() ) as executor:
for i in range(1, diff_count + 1):
LOG.debug("Starting amphorae number %d ...", i)
executor.submit(self.cw.create_amphora)
else: else:
LOG.debug("Current spare amphora count satisfies the requirement") LOG.debug("Current spare amphora count satisfies the requirement")