summaryrefslogtreecommitdiff
path: root/app/services/ci/destroy_pipeline_service.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-04-12 12:29:47 -0700
committerStan Hu <stanhu@gmail.com>2019-04-15 08:10:10 -0700
commit16259796539f19f7b04ad078a28aa38c5b50912f (patch)
treed3596f714417223feb8b788a8f037ce2406e4531 /app/services/ci/destroy_pipeline_service.rb
parent0a99e0220d9371423039f05f700af3675b26624f (diff)
downloadgitlab-ce-16259796539f19f7b04ad078a28aa38c5b50912f.tar.gz
Properly expire all pipeline caches when pipeline is deletedsh-fix-pipeline-delete-caching
When deleting a pipeline, only some of the cache structures were being expired, but not the full pipeline list. We have to synchronously schedule a pipeline cache expiration because the pipeline will be deleted if the Sidekiq expiration job picks it up. To do this, properly extract all the logic buried in the Sidekiq worker into a service, and then call the service. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/60469
Diffstat (limited to 'app/services/ci/destroy_pipeline_service.rb')
-rw-r--r--app/services/ci/destroy_pipeline_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/ci/destroy_pipeline_service.rb b/app/services/ci/destroy_pipeline_service.rb
index 2292ec42b16..9aea20c45f7 100644
--- a/app/services/ci/destroy_pipeline_service.rb
+++ b/app/services/ci/destroy_pipeline_service.rb
@@ -5,9 +5,9 @@ module Ci
def execute(pipeline)
raise Gitlab::Access::AccessDeniedError unless can?(current_user, :destroy_pipeline, pipeline)
- pipeline.destroy!
+ Ci::ExpirePipelineCacheService.new.execute(pipeline, delete: true)
- Gitlab::Cache::Ci::ProjectPipelineStatus.new(pipeline.project).delete_from_cache
+ pipeline.destroy!
end
end
end