refs #2723 Improves logging in check_aux_files function

pull/42/head
Nicolas Arenas 2025-08-29 12:00:37 +02:00
parent ae1cec5cd4
commit 75efb96653
1 changed files with 12 additions and 1 deletions

View File

@ -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")