1625979653
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
17 lines
413 B
Ruby
17 lines
413 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ExpirePipelineCacheWorker
|
|
include ApplicationWorker
|
|
include PipelineQueue
|
|
|
|
queue_namespace :pipeline_cache
|
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
|
def perform(pipeline_id)
|
|
pipeline = Ci::Pipeline.find_by(id: pipeline_id)
|
|
return unless pipeline
|
|
|
|
Ci::ExpirePipelineCacheService.new.execute(pipeline)
|
|
end
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
|
end
|