From ad7c6e10909fd4ac10466d62a7b3e5a77804a233 Mon Sep 17 00:00:00 2001 From: radhika Date: Fri, 10 Jul 2015 10:44:10 -0400 Subject: [PATCH] 6445: when a task does not have finished_at time, use the finished_at time from it's job - if one is available. --- .../_show_components_running.html.erb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb b/apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb index 6fa409a1ce..b0b8601a0c 100644 --- a/apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb +++ b/apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb @@ -12,6 +12,7 @@ <% pipeline_jobs = render_pipeline_jobs %> <% job_uuids = pipeline_jobs.map { |j| j[:job].andand[:uuid] }.compact %> +<% job_uuids_finished = {}; pipeline_jobs.map { |j| job_uuids_finished[j[:job].andand[:uuid]] = j[:job].andand[:finished_at] } %> <% if @object.state == 'Paused' %>

@@ -65,11 +66,12 @@ <% end %> for <% cputime = tasks.map { |task| - if task.started_at - (if task.finished_at then task.finished_at else Time.now() end) - task.started_at - else - 0 - end + if task.started_at + finished_at = task.finished_at || job_uuids_finished[task.job_uuid] || Time.now() + finished_at - task.started_at + else + 0 + end }.reduce(:+) || 0 %> <%= render_runtime(runningtime, true, false) %><% if (walltime - runningtime) > 0 %> (<%= render_runtime(walltime - runningtime, true, false) %> queued)<% end %><% if cputime == 0 %>.<% else %> -- 2.30.2