BigW Consortium Gitlab

Commit 5e7d99d3 by Lin Jen-Shin

Rename to total_duration and we're not using CommitStatus.duration

parent 7d9bdac6
......@@ -78,7 +78,7 @@ module Ci
CommitStatus.where(pipeline: pluck(:id)).stages
end
def self.duration
def self.total_duration
where.not(duration: nil).sum(:duration)
end
......
......@@ -103,11 +103,6 @@ class CommitStatus < ActiveRecord::Base
end
end
def self.duration
select(:started_at, :finished_at).all.
map(&:duration).compact.inject(0, &:+)
end
def ignored?
allow_failure? && (failed? || canceled?)
end
......
......@@ -57,9 +57,8 @@
= link_to builds_namespace_project_commit_path(@project.namespace, @project, @commit.id), class: "ci-status-link ci-status-icon-#{@commit.status}" do
= ci_icon_for_status(@commit.status)
= ci_label_for_status(@commit.status)
- if @commit.pipelines.duration
in
= time_interval_in_words @commit.pipelines.duration
in
= time_interval_in_words @commit.pipelines.total_duration
.commit-box.content-block
%h3.commit-title
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment