summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@gitlab.com>2017-03-14 12:31:39 +0100
committerBob Van Landuyt <bob@gitlab.com>2017-03-16 12:31:27 +0100
commit4b249d522c0077113745225fe945d8629c58fa34 (patch)
treecaeffcbc56e9f70d9d841d2e72bbc0466bed6d0c /app/models
parente36f444930a5f2b0c0c4ca322125a6c831122e90 (diff)
downloadgitlab-ce-4b249d522c0077113745225fe945d8629c58fa34.tar.gz
Update the pipeline cache when updating a pipeline-status
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/pipeline.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 8a5a9aa4adb..65d08a22b4c 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -22,6 +22,7 @@ module Ci
validate :valid_commit_sha, unless: :importing?
after_create :keep_around_commits, unless: :importing?
+ after_create :refresh_build_status_cache
state_machine :status, initial: :created do
event :enqueue do
@@ -328,6 +329,7 @@ module Ci
when 'manual' then block
end
end
+ refresh_build_status_cache
end
def predefined_variables
@@ -369,6 +371,10 @@ module Ci
.fabricate!
end
+ def refresh_build_status_cache
+ Ci::PipelineStatus.new(project, sha: sha, status: status).store_in_cache_if_needed
+ end
+
private
def pipeline_data