summaryrefslogtreecommitdiff
path: root/app/models/commit_status.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 15:44:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 15:44:42 +0000
commit4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch)
tree5423a1c7516cffe36384133ade12572cf709398d /app/models/commit_status.rb
parente570267f2f6b326480d284e0164a6464ba4081bc (diff)
downloadgitlab-ce-4555e1b21c365ed8303ffb7a3325d773c9b8bf31.tar.gz
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r--app/models/commit_status.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index e989129209a..c5ba19438cd 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -214,8 +214,14 @@ class CommitStatus < ApplicationRecord
allow_failure? && (failed? || canceled?)
end
+ # Time spent running.
def duration
- calculate_duration
+ calculate_duration(started_at, finished_at)
+ end
+
+ # Time spent in the pending state.
+ def queued_duration
+ calculate_duration(queued_at, started_at)
end
def latest?
@@ -286,4 +292,4 @@ class CommitStatus < ApplicationRecord
end
end
-CommitStatus.prepend_if_ee('::EE::CommitStatus')
+CommitStatus.prepend_mod_with('CommitStatus')