diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2017-03-14 12:31:39 +0100 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2017-03-16 12:31:27 +0100 |
commit | 4b249d522c0077113745225fe945d8629c58fa34 (patch) | |
tree | caeffcbc56e9f70d9d841d2e72bbc0466bed6d0c /app/models | |
parent | e36f444930a5f2b0c0c4ca322125a6c831122e90 (diff) | |
download | gitlab-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.rb | 6 |
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 |