Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@gitlab.com>2017-03-31 16:47:34 +0300
committerBob Van Landuyt <bob@gitlab.com>2017-04-07 18:24:11 +0300
commita6d313001a9df7f44402b1a0fca8bbd631b9fd87 (patch)
tree7be660e40f24e9c4826393fcf6912e9efbc0550d /lib
parent47abf00b24efb0f6263ea37eddf2d6587950c5ee (diff)
Wrap updating of cache after pipeline transition in class method
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/cache/ci/project_build_status.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/cache/ci/project_build_status.rb b/lib/gitlab/cache/ci/project_build_status.rb
index d3a0218e6b4..3982caa4a47 100644
--- a/lib/gitlab/cache/ci/project_build_status.rb
+++ b/lib/gitlab/cache/ci/project_build_status.rb
@@ -15,6 +15,10 @@ module Gitlab
end
end
+ def self.update_for_pipeline(pipeline)
+ new(pipeline.project, sha: pipeline.sha, status: pipeline.status).store_in_cache_if_needed
+ end
+
def initialize(project, sha: nil, status: nil)
@project = project
@sha = sha