Skip discovered outputs

This prevents overwriting discovered metadata with default values,
and is more efficient than doing this twice.
This commit is contained in:
mvdbeek
2022-04-23 12:01:32 +02:00
parent 02ac5b3c9e
commit 4cc3f33f30
3 changed files with 5 additions and 0 deletions
@@ -547,6 +547,7 @@ def collect_primary_datasets(job_context: Union[JobContext, SessionlessJobContex
outdata.init_meta()
outdata.set_meta()
outdata.set_peek()
outdata.discovered = True
sa_session = job_context.sa_session
if sa_session:
sa_session.add(outdata)
+3
View File
@@ -1852,6 +1852,9 @@ class JobWrapper(HasResourceParameters):
job.job_messages = [str(e)]
for dataset_assoc in output_dataset_associations:
if getattr(dataset_assoc.dataset, "discovered", False):
# skip outputs that have been discovered
continue
context = self.get_dataset_finish_context(job_context, dataset_assoc)
# should this also be checking library associations? - can a library item be added from a history before the job has ended? -
# lets not allow this to occur
+1
View File
@@ -815,6 +815,7 @@ def persist_hdas(elements, model_persistence_context, final_job_state="ok"):
final_job_state=state,
storage_callbacks=storage_callbacks,
)
dataset.discovered = True
if not hda_id:
datasets.append(dataset)