chg: Improve logging for archiver.

pull/526/head
Raphaël Vinot 2022-09-23 14:32:42 +02:00
parent c7ca251e7a
commit 18b0b6e3cd
1 changed files with 2 additions and 1 deletions

View File

@ -49,8 +49,9 @@ class Archiver(AbstractManager):
try:
with index_file.open('r') as _f:
current_index = {uuid: dirname for uuid, dirname in csv.reader(_f) if (index_file.parent / dirname) in existing_captures}
except Exception:
except Exception as e:
# the index file is broken, it will be recreated.
self.logger.warning(f'Index for {root_dir} broken, recreating it: {e}')
pass
if not current_index:
index_file.unlink()