Merge "Add exception handling for housekeeping service"
This commit is contained in:
commit
047433b722
|
@ -45,7 +45,11 @@ def spare_amphora_check():
|
||||||
spare_amp = house_keeping.SpareAmphora()
|
spare_amp = house_keeping.SpareAmphora()
|
||||||
while not spare_amp_thread_event.is_set():
|
while not spare_amp_thread_event.is_set():
|
||||||
LOG.debug("Initiating spare amphora check...")
|
LOG.debug("Initiating spare amphora check...")
|
||||||
spare_amp.spare_check()
|
try:
|
||||||
|
spare_amp.spare_check()
|
||||||
|
except Exception as e:
|
||||||
|
LOG.debug('spare_amphora caught the following exception and '
|
||||||
|
'is restarting: {}'.format(e))
|
||||||
spare_amp_thread_event.wait(interval)
|
spare_amp_thread_event.wait(interval)
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,8 +66,12 @@ def db_cleanup():
|
||||||
db_cleanup = house_keeping.DatabaseCleanup()
|
db_cleanup = house_keeping.DatabaseCleanup()
|
||||||
while not db_cleanup_thread_event.is_set():
|
while not db_cleanup_thread_event.is_set():
|
||||||
LOG.debug("Initiating the cleanup of old resources...")
|
LOG.debug("Initiating the cleanup of old resources...")
|
||||||
db_cleanup.delete_old_amphorae()
|
try:
|
||||||
db_cleanup.cleanup_load_balancers()
|
db_cleanup.delete_old_amphorae()
|
||||||
|
db_cleanup.cleanup_load_balancers()
|
||||||
|
except Exception as e:
|
||||||
|
LOG.debug('db_cleanup caught the following exception and '
|
||||||
|
'is restarting: {}'.format(e))
|
||||||
db_cleanup_thread_event.wait(interval)
|
db_cleanup_thread_event.wait(interval)
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,7 +83,11 @@ def cert_rotation():
|
||||||
cert_rotate = house_keeping.CertRotation()
|
cert_rotate = house_keeping.CertRotation()
|
||||||
while not cert_rotate_thread_event.is_set():
|
while not cert_rotate_thread_event.is_set():
|
||||||
LOG.debug("Initiating certification rotation ...")
|
LOG.debug("Initiating certification rotation ...")
|
||||||
cert_rotate.rotate()
|
try:
|
||||||
|
cert_rotate.rotate()
|
||||||
|
except Exception as e:
|
||||||
|
LOG.debug('cert_rotation caught the following exception and '
|
||||||
|
'is restarting: {}'.format(e))
|
||||||
cert_rotate_thread_event.wait(interval)
|
cert_rotate_thread_event.wait(interval)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue