fix: Avoid crash if capture timestamp for UUID is incorrect

Related to crash and probably #922
pull/923/head
Raphaël Vinot 2024-06-23 15:10:12 +02:00
parent e24844dc89
commit 37e92dbaf1
1 changed files with 6 additions and 1 deletions

View File

@ -308,7 +308,12 @@ class Archiver(AbstractManager):
capture_time_isoformat = os.path.basename(path) capture_time_isoformat = os.path.basename(path)
if not capture_time_isoformat: if not capture_time_isoformat:
continue continue
capture_time = make_ts_from_dirname(capture_time_isoformat) try:
capture_time = make_ts_from_dirname(capture_time_isoformat)
except ValueError:
self.logger.warning(f'Invalid capture time for {uuid}: {capture_time_isoformat}')
self.redis.hdel('lookup_dirs', uuid)
continue
if capture_time >= cut_time: if capture_time >= cut_time:
continue continue
# archive the capture. # archive the capture.