mirror of https://github.com/CIRCL/lookyloo
fix: Avois error when capture is in a weird state
parent
1533e33ede
commit
29fb60e9b7
|
@ -102,14 +102,19 @@ class Archiver(AbstractManager):
|
||||||
continue
|
continue
|
||||||
with uuid_file.open() as _f:
|
with uuid_file.open() as _f:
|
||||||
uuid = _f.read().strip()
|
uuid = _f.read().strip()
|
||||||
if not uuid:
|
try:
|
||||||
self.logger.warning(f'{uuid_file} is empty')
|
if not uuid:
|
||||||
shutil.move(str(capture_dir), str(get_homedir() / 'discarded_captures'))
|
self.logger.warning(f'{uuid_file} is empty')
|
||||||
continue
|
shutil.move(str(capture_dir), str(get_homedir() / 'discarded_captures'))
|
||||||
if uuid in current_index:
|
continue
|
||||||
self.logger.warning(f'Duplicate UUID ({uuid}) in {current_index[uuid]} and {uuid_file.parent.name}')
|
if uuid in current_index:
|
||||||
shutil.move(str(capture_dir), str(get_homedir() / 'discarded_captures'))
|
self.logger.warning(f'Duplicate UUID ({uuid}) in {current_index[uuid]} and {uuid_file.parent.name}')
|
||||||
|
shutil.move(str(capture_dir), str(get_homedir() / 'discarded_captures'))
|
||||||
|
continue
|
||||||
|
except OSError as e:
|
||||||
|
self.logger.warning(f'Error when discarding capture {capture_dir}: {e}')
|
||||||
continue
|
continue
|
||||||
|
|
||||||
current_index[uuid] = uuid_file.parent.name
|
current_index[uuid] = uuid_file.parent.name
|
||||||
|
|
||||||
if not current_index:
|
if not current_index:
|
||||||
|
|
Loading…
Reference in New Issue