From fe0ae01f4a3bcec321587bef415ddb7c745004bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barth=C3=A9l=C3=A9my=20von=20Haller?= Date: Tue, 29 Oct 2024 17:23:14 +0100 Subject: [PATCH] Fix bug in multiple_per_run (#2456) --- .../RepoCleaner/qcrepocleaner/rules/multiple_per_run.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Framework/script/RepoCleaner/qcrepocleaner/rules/multiple_per_run.py b/Framework/script/RepoCleaner/qcrepocleaner/rules/multiple_per_run.py index f93f3e6de8..6ab1aebc32 100644 --- a/Framework/script/RepoCleaner/qcrepocleaner/rules/multiple_per_run.py +++ b/Framework/script/RepoCleaner/qcrepocleaner/rules/multiple_per_run.py @@ -38,7 +38,7 @@ def process(ccdb: Ccdb, object_path: str, delay: int, from_timestamp: int, to_t Go through the map: for each run (resp. run+pass+period) Get SOR (validity of first object) - if SOR < now - mw_deletion_delay + if mw_deletion_delay != -1 and SOR < now - mw_deletion_delay delete the data for this run if SOR < now - delay @@ -106,7 +106,7 @@ def process(ccdb: Ccdb, object_path: str, delay: int, from_timestamp: int, to_t elif not (from_timestamp < first_object.createdAt < to_timestamp): # not in the allowed period logger.debug(f" not in the allowed period, skip this bucket") preservation_list.extend(run_versions) - elif first_object.createdAtDt < datetime.now() - timedelta(minutes=mw_deletion_delay): + elif mw_deletion_delay != -1 and first_object.createdAtDt < datetime.now() - timedelta(minutes=mw_deletion_delay): # moving windows case logger.debug(f" after mw_deletion_delay period, delete this bucket") for v in run_versions: if "/mw/" in v.path: # this is because we really don't want to take the risk of batch deleting non moving windows