From 37e92dbaf1b0ceb911506040a200b185e15bbcef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Sun, 23 Jun 2024 15:10:12 +0200 Subject: [PATCH] fix: Avoid crash if capture timestamp for UUID is incorrect Related to crash and probably #922 --- bin/archiver.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/archiver.py b/bin/archiver.py index c6f528f..efe0583 100755 --- a/bin/archiver.py +++ b/bin/archiver.py @@ -308,7 +308,12 @@ class Archiver(AbstractManager): capture_time_isoformat = os.path.basename(path) if not capture_time_isoformat: 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: continue # archive the capture.