diff options
author | Stan Hu <stanhu@gmail.com> | 2019-03-26 01:01:14 -0500 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-03-26 01:04:06 -0500 |
commit | 2d233dac4573f8d321464712333d4ff8bcb767af (patch) | |
tree | bf4bb89ac286216bc0db2a2ee7ca8f823819038e /app/services/ci | |
parent | 61b2f70fdcbc8dce7504c6599f57e2db703cc5ae (diff) | |
download | gitlab-ce-2d233dac4573f8d321464712333d4ff8bcb767af.tar.gz |
Clear pipeline status cache after destruction of pipeline
`project.pipeline_status.has_status?` is cached, which can lead to Error
500s in the UI if the this condition is used to check whether a pipeline
exists for a commit. We now expire the cache to ensure that the
information is consistent.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/59453
Diffstat (limited to 'app/services/ci')
-rw-r--r-- | app/services/ci/destroy_pipeline_service.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/services/ci/destroy_pipeline_service.rb b/app/services/ci/destroy_pipeline_service.rb index 5c4a34043c1..2292ec42b16 100644 --- a/app/services/ci/destroy_pipeline_service.rb +++ b/app/services/ci/destroy_pipeline_service.rb @@ -6,6 +6,8 @@ module Ci raise Gitlab::Access::AccessDeniedError unless can?(current_user, :destroy_pipeline, pipeline) pipeline.destroy! + + Gitlab::Cache::Ci::ProjectPipelineStatus.new(pipeline.project).delete_from_cache end end end |