Don't report async pendings on exception
If we encounter an exception trying to gather async pendings 'async' doesn't exist and the cronjob ends up erroring out and leaving behind a stale lock file. Change-Id: I70a6d3f00bd2c9ce742e6d16af93804280707040
This commit is contained in:
parent
cd378edd2e
commit
f9d14971c2
@ -63,12 +63,10 @@ def main():
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
try:
|
try:
|
||||||
asyncs = get_async_count(device_dir, logger)
|
asyncs = get_async_count(device_dir, logger)
|
||||||
|
dump_recon_cache({'async_pending': asyncs}, cache_file, logger)
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.exception(
|
logger.exception(
|
||||||
_('Exception during recon-cron while accessing devices'))
|
_('Exception during recon-cron while accessing devices'))
|
||||||
|
|
||||||
dump_recon_cache({'async_pending': asyncs}, cache_file, logger)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.rmdir(lock_dir)
|
os.rmdir(lock_dir)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
Loading…
Reference in New Issue
Block a user