diff --git a/Framework/script/RepoCleaner/qcrepocleaner/Ccdb.py b/Framework/script/RepoCleaner/qcrepocleaner/Ccdb.py index 407cec341..75b593e77 100644 --- a/Framework/script/RepoCleaner/qcrepocleaner/Ccdb.py +++ b/Framework/script/RepoCleaner/qcrepocleaner/Ccdb.py @@ -42,9 +42,9 @@ def __init__(self, path: str, validFrom, validTo, createdAt, uuid=None, metadata def __repr__(self): if "Run" in self.metadata or "RunNumber" in self.metadata: run_number = self.metadata["Run"] if "Run" in self.metadata else self.metadata["RunNumber"] - return f"Version of object {self.path} valid from {self.validFromAsDt}, run {run_number} (uuid {self.uuid})" + return f"Version of object {self.path} created at {self.createdAtDt.strftime('%Y-%m-%d %H:%M:%S')}, valid from {self.validFromAsDt.strftime('%Y-%m-%d %H:%M:%S')}, run {run_number} (uuid {self.uuid})" else: - return f"Version of object {self.path} valid from {self.validFromAsDt} (uuid {self.uuid}, " \ + return f"Version of object {self.path} created at {self.createdAtDt.strftime('%Y-%m-%d %H:%M:%S')}, valid from {self.validFromAsDt.strftime('%Y-%m-%d %H:%M:%S')} (uuid {self.uuid}, " \ f"ts {self.validFrom})" diff --git a/Framework/script/RepoCleaner/qcrepocleaner/o2-qc-repo-cleaner b/Framework/script/RepoCleaner/qcrepocleaner/o2-qc-repo-cleaner index 5229bba50..6923caf11 100755 --- a/Framework/script/RepoCleaner/qcrepocleaner/o2-qc-repo-cleaner +++ b/Framework/script/RepoCleaner/qcrepocleaner/o2-qc-repo-cleaner @@ -178,7 +178,7 @@ def downloadConfigFromConsul(consul_url: str, consul_port: str, file_name: str): :return: the path to the config file """ - logging.debug("Get it from consul") + logging.debug(f"Download config file from consul : {consul_url} {consul_port} {file_name}") consul_server = consul.Consul(host=consul_url, port=consul_port) file_path = 'o2/components/qc/ANY/any/' + file_name index, data = consul_server.kv.get(key=file_path) @@ -393,7 +393,7 @@ def run(args, ccdb_url, rules): logging.info(f" *** DONE *** (total deleted: {ccdb.counter_deleted}, total updated: {ccdb.counter_validity_updated})") message = datetime.today().strftime('%Y-%m-%d-%H:%M:%S') storeCrucialLog(message + f" - End of the cleaner (total deleted: {ccdb.counter_deleted}, total updated: {ccdb.counter_validity_updated})") - if not args.dry_run: + if not args.dry_run and not args.ignore_last_execution: storeSavedTimestamp() # **************** diff --git a/Framework/script/RepoCleaner/qcrepocleaner/rules/skip.py b/Framework/script/RepoCleaner/qcrepocleaner/rules/skip.py index 852ed1f3d..8767d1351 100644 --- a/Framework/script/RepoCleaner/qcrepocleaner/rules/skip.py +++ b/Framework/script/RepoCleaner/qcrepocleaner/rules/skip.py @@ -25,8 +25,10 @@ def process(ccdb: Ccdb, object_path: str, delay: int, from_timestamp: int, to_t ''' logger.debug(f"Plugin 'skip' processing {object_path}") - - return {"deleted" : 0, "preserved": 0} + + versions = ccdb.getVersionsList(object_path) + + return {"deleted": 0, "preserved": len(versions), "updated": 0} def main():