Skip to content

Commit

Permalink
Always update job metadata in process_successful_job
Browse files Browse the repository at this point in the history
  • Loading branch information
mbthornton-lbl committed Dec 4, 2024
1 parent 270afce commit 4b14311
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions nmdc_automation/workflow_automation/watch_nmdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,13 @@ def process_successful_job(self, job: WorkflowJob) -> Database:

database = Database()

# get job runner metadata if needed
if not job.job.metadata:
logger.info(f"Getting job runner metadata for job {job.workflow.job_runner_id}")
job.job.job_id = job.workflow.job_runner_id
metadata = job.job.get_job_metadata()
m_dict = yaml.safe_load(yaml_dumper.dumps(metadata))
logger.debug(f"Job runner metadata: {m_dict}")
job.job.metadata = metadata
# Upate the job metadata
logger.info(f"Getting job runner metadata for job {job.workflow.job_runner_id}")
job.job.job_id = job.workflow.job_runner_id
metadata = job.job.get_job_metadata()
m_dict = yaml.safe_load(yaml_dumper.dumps(metadata))
logger.debug(f"Job runner metadata: {m_dict}")
job.job.metadata = metadata

data_objects = job.make_data_objects(output_dir=output_path)
if not data_objects:
Expand Down

0 comments on commit 4b14311

Please sign in to comment.