From 0a6ea073f6a74e025c39f111f27398da3e83dde2 Mon Sep 17 00:00:00 2001 From: Michael Thornton Date: Tue, 3 Dec 2024 09:44:13 -0800 Subject: [PATCH] set ended_at_time from end in job metadata and update state --- nmdc_automation/workflow_automation/watch_nmdc.py | 1 + nmdc_automation/workflow_automation/wfutils.py | 1 + 2 files changed, 2 insertions(+) diff --git a/nmdc_automation/workflow_automation/watch_nmdc.py b/nmdc_automation/workflow_automation/watch_nmdc.py index 68bfd3a3..d08d0f22 100644 --- a/nmdc_automation/workflow_automation/watch_nmdc.py +++ b/nmdc_automation/workflow_automation/watch_nmdc.py @@ -264,6 +264,7 @@ def process_successful_job(self, job: WorkflowJob) -> Database: logger.info(f"Created workflow execution record for job {job.opid}") job.done = True + job.workflow.state["end"] = workflow_execution.ended_at_time self.file_handler.write_metadata_if_not_exists(job) self.save_checkpoint() return database diff --git a/nmdc_automation/workflow_automation/wfutils.py b/nmdc_automation/workflow_automation/wfutils.py index c63b1847..c9da153c 100755 --- a/nmdc_automation/workflow_automation/wfutils.py +++ b/nmdc_automation/workflow_automation/wfutils.py @@ -551,6 +551,7 @@ def make_workflow_execution(self, data_objects: List[DataObject]) -> WorkflowExe """ wf_dict = self.as_workflow_execution_dict wf_dict["has_output"] = [dobj.id for dobj in data_objects] + wf_dict["ended_at_time"] = self.job.metadata.get("end") # workflow-specific keys logical_names = set()