diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2017-03-30 09:15:42 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2017-04-07 17:24:11 +0200 |
commit | 47abf00b24efb0f6263ea37eddf2d6587950c5ee (patch) | |
tree | 9159be8bffb2208834b23a0633a097fdb92f103c /app | |
parent | 9082d1e046a8da394ea0b271f9f3fea909bb102c (diff) | |
download | gitlab-ce-47abf00b24efb0f6263ea37eddf2d6587950c5ee.tar.gz |
Update project build status cache when transitioning
Diffstat (limited to 'app')
-rw-r--r-- | app/models/ci/pipeline.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 8ee1a0580e1..b1cabbcd53e 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -31,7 +31,6 @@ 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 @@ -99,6 +98,7 @@ module Ci PipelineHooksWorker.perform_async(id) Ci::ExpirePipelineCacheService.new(project, nil) .execute(pipeline) + refresh_project_build_status_cache end end @@ -351,7 +351,6 @@ module Ci when 'manual' then block end end - refresh_build_status_cache end def predefined_variables @@ -393,7 +392,7 @@ module Ci .fabricate! end - def refresh_build_status_cache + def refresh_project_build_status_cache Gitlab::Cache::Ci::ProjectBuildStatus.new(project, sha: sha, status: status).store_in_cache_if_needed end |