Commit a315e7dc authored by David Mendez's avatar David Mendez
Browse files

Merge branch 'staging' into 'master'

Write lsf status check log to file instead of database

See merge request !76
parents 276ef8dc 35b9219d
......@@ -7,6 +7,7 @@ import hashlib
import json
import shutil
import copy
import os
from sqlalchemy import and_
......@@ -506,11 +507,14 @@ def append_to_lsf_check_log(job_id, checker_name, check_log):
:param check_log: text to append
"""
job = get_job_by_id(job_id)
if job.lsf_check_log is None:
job.lsf_check_log = ''
job.lsf_check_log += f'{app_utils.get_utc_now().isoformat()}-{checker_name}: {check_log}\n'
save_job(job)
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')
with open(log_file_path, "a") as log_file:
log_file.write(log_msg)
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