Commit 35b9219d authored by David Mendez's avatar David Mendez
Browse files

If job run dir path is none, print lsf check log to app logging

parent ec1764aa
...@@ -507,10 +507,14 @@ def append_to_lsf_check_log(job_id, checker_name, check_log): ...@@ -507,10 +507,14 @@ def append_to_lsf_check_log(job_id, checker_name, check_log):
:param check_log: text to append :param check_log: text to append
""" """
job = get_job_by_id(job_id) job = get_job_by_id(job_id)
log_msg = f'{app_utils.get_utc_now().isoformat()}-{checker_name}: {check_log}\n'
if job.run_dir_path is None:
app_logging.debug(log_msg)
return
log_file_path = os.path.join(job.run_dir_path, 'status_check_log.txt') log_file_path = os.path.join(job.run_dir_path, 'status_check_log.txt')
with open(log_file_path, "a") as log_file: with open(log_file_path, "a") as log_file:
log_file.write(f'{app_utils.get_utc_now().isoformat()}-{checker_name}: {check_log}\n') log_file.write(log_msg)
def set_last_lsf_check_status(job_id, script_status): def set_last_lsf_check_status(job_id, script_status):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment