Merge "Make housekeeping build spares with an executor"
This commit is contained in:
@@ -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")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user