Skip to content

Commit

Permalink
getSubmissionStatus uses workflow cost when actual cost is not populated
Browse files Browse the repository at this point in the history
  • Loading branch information
davidangb committed Jan 24, 2025
1 parent 874eda6 commit aeeb914
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,12 @@ class SubmissionsService(
case Success(costMap) =>
val costedWorkflows = submission.workflows.map { workflow =>
workflow.workflowId match {
case Some(wfId) => workflow.copy(cost = costMap.get(wfId))
case None => workflow
case Some(wfId) =>
// prefer the actual cost from the cost map;
// use Cromwell-estimated cost from the workflow if not
val calculatedCost = costMap.get(wfId).orElse(workflow.cost)
workflow.copy(cost = calculatedCost)
case None => workflow
}
}
val costedSubmission = submission.copy(cost = Some(costMap.values.sum), workflows = costedWorkflows)
Expand Down

0 comments on commit aeeb914

Please sign in to comment.