Merge "No need to do a shutdown(wait=True) when in a context-manager"

This commit is contained in:
Jenkins 2017-06-27 06:22:13 +00:00 committed by Gerrit Code Review
commit a6b3c798bf
2 changed files with 32 additions and 38 deletions

View File

@ -35,7 +35,6 @@ class HealthManager(object):
amp_health_repo = repo.AmphoraHealthRepository()
with futures.ThreadPoolExecutor(max_workers=self.threads) as executor:
try:
# Don't start checking immediately, as the health manager may
# have been down for a while and amphorae not able to check in.
LOG.debug("Pausing before starting health check")
@ -57,5 +56,3 @@ class HealthManager(object):
LOG.info("Failed over %s amphora",
failover_count)
time.sleep(CONF.health_manager.health_check_interval)
finally:
executor.shutdown(wait=True)

View File

@ -110,7 +110,6 @@ class CertRotation(object):
amp_repo = repo.AmphoraRepository()
with futures.ThreadPoolExecutor(max_workers=self.threads) as executor:
try:
session = db_api.get_session()
rotation_count = 0
while True:
@ -123,5 +122,3 @@ class CertRotation(object):
if rotation_count > 0:
LOG.info("Rotated certificates for %s amphora" %
rotation_count)
finally:
executor.shutdown(wait=True)