From 75efb96653bb5b1c543614aa0cbd1fd080928e2e Mon Sep 17 00:00:00 2001 From: Nicolas Arenas Date: Fri, 29 Aug 2025 12:00:37 +0200 Subject: [PATCH] refs #2723 Improves logging in check_aux_files function --- api/repo_api.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/api/repo_api.py b/api/repo_api.py index 718159c..fd20c80 100644 --- a/api/repo_api.py +++ b/api/repo_api.py @@ -444,7 +444,18 @@ def check_aux_files(image_file_path, job_id): while True: # Si faltan archivos auxiliares por crear, imprimimos un mensaje en la API: if not os.path.exists(f"{image_file_path}.size") or not os.path.exists(f"{image_file_path}.sum") or not os.path.exists(f"{image_file_path}.full.sum") or not os.path.exists(f"{image_file_path}.torrent") or not os.path.exists(f"{image_file_path}.info.checked"): - journal.send("Task in process (auxiliar files remaining)", PRIORITY=journal.LOG_INFO, SYSLOG_IDENTIFIER="ogrepo-api_DEBUG") + missing_files = [] + if not os.path.exists(f"{image_file_path}.size"): + missing_files.append(f"{image_file_path}.size") + if not os.path.exists(f"{image_file_path}.sum"): + missing_files.append(f"{image_file_path}.sum") + if not os.path.exists(f"{image_file_path}.full.sum"): + missing_files.append(f"{image_file_path}.full.sum") + if not os.path.exists(f"{image_file_path}.torrent"): + missing_files.append(f"{image_file_path}.torrent") + if not os.path.exists(f"{image_file_path}.info.checked"): + missing_files.append(f"{image_file_path}.info.checked") + journal.send(f"Task in process (auxiliar files remaining): {', '.join(missing_files)}", PRIORITY=journal.LOG_INFO, SYSLOG_IDENTIFIER="ogrepo-api_DEBUG") # Si ya se han creado todos los archivos auxiliares, imprimimos un mensaje en la API, respondemos a ogCore y salimos del bucle: else: journal.send("Task finalized (all auxilar files created)", PRIORITY=journal.LOG_INFO, SYSLOG_IDENTIFIER="ogrepo-api_DEBUG")