From 9eb14548e36765caef530f7dba993fd585422e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Mon, 29 Apr 2024 17:26:46 +0200 Subject: [PATCH] fix: run cleanup properly when auto_report == 0 --- bin/async_capture.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/async_capture.py b/bin/async_capture.py index 38b48e3..d471784 100755 --- a/bin/async_capture.py +++ b/bin/async_capture.py @@ -102,19 +102,21 @@ class AsyncCapture(AbstractManager): ) if 'auto_report' in to_capture: + send_report = True settings = {} if isinstance(to_capture['auto_report'], str): if to_capture['auto_report'].isdigit(): # auto_report was a bool in the submission, it can be 1 or 0. 0 means no. if to_capture['auto_report'] == '0': - continue + send_report = False else: settings = json.loads(to_capture['auto_report']) elif isinstance(to_capture['auto_report'], dict): settings = to_capture['auto_report'] - self.lookyloo.send_mail(uuid, email=settings.get('email', ''), - comment=settings.get('comment')) + if send_report: + self.lookyloo.send_mail(uuid, email=settings.get('email', ''), + comment=settings.get('comment')) lazy_cleanup = self.lookyloo.redis.pipeline() if queue and self.lookyloo.redis.zscore('queues', queue):