From 54deae4783d3b083acb018d41cdd9707e64333a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 24 Sep 2024 16:28:46 +0200 Subject: [PATCH] fix: Properly catch broken settings in bg processing --- bin/background_processing.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/background_processing.py b/bin/background_processing.py index 9d6bffcd..cd31c274 100755 --- a/bin/background_processing.py +++ b/bin/background_processing.py @@ -14,7 +14,7 @@ from lacuscore import CaptureStatus as CaptureStatusCore, CaptureSettingsError from lookyloo import Lookyloo from lookyloo.exceptions import LacusUnreachable from lookyloo.default import AbstractManager, get_config, get_homedir, safe_create_dir -from lookyloo.helpers import ParsedUserAgent, serialize_to_json +from lookyloo.helpers import ParsedUserAgent, serialize_to_json, CaptureSettings from pylacus import CaptureStatus as CaptureStatusPy logging.config.dictConfig(get_config('logging')) @@ -110,7 +110,8 @@ class Processing(AbstractManager): self.logger.info(f'Found a non-queued capture ({uuid}), retrying now.') # This capture couldn't be queued and we created the uuid locally try: - if query := self.lookyloo.get_capture_settings(uuid): + if capture_settings := self.lookyloo.redis.hgetall(uuid): + query = CaptureSettings(**capture_settings) try: new_uuid = self.lookyloo.lacus.enqueue( url=query.url,