summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-08-29 23:40:15 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-08-29 23:40:15 +0800
commite9e7c3788d1b2061e321032db4c72178f21ca6bd (patch)
tree2ed5770908508d3ef74807a62c1143e0dce198da /lib
parentf6051d71d62dd5b98daad44422867345685ed427 (diff)
downloadgitlab-ce-e9e7c3788d1b2061e321032db4c72178f21ca6bd.tar.gz
no builds no pending
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/pipeline_duration.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitlab/ci/pipeline_duration.rb b/lib/gitlab/ci/pipeline_duration.rb
index e4c0be3b640..b9d0006182e 100644
--- a/lib/gitlab/ci/pipeline_duration.rb
+++ b/lib/gitlab/ci/pipeline_duration.rb
@@ -82,6 +82,8 @@ module Gitlab
end
def process_pending_duration(segments, duration)
+ return 0 if segments.empty?
+
total = segments.last.last - segments.first.first
total - duration
end