debian-mirror-gitlab/app/workers/expire_pipeline_cache_worker.rb
2021-06-08 01:23:25 +05:30

23 lines
523 B
Ruby

# frozen_string_literal: true
class ExpirePipelineCacheWorker
include ApplicationWorker
sidekiq_options retry: 3
include PipelineQueue
queue_namespace :pipeline_cache
urgency :high
worker_resource_boundary :cpu
idempotent!
# rubocop: disable CodeReuse/ActiveRecord
def perform(pipeline_id)
pipeline = Ci::Pipeline.eager_load_project.find_by(id: pipeline_id)
return unless pipeline
Ci::ExpirePipelineCacheService.new.execute(pipeline)
end
# rubocop: enable CodeReuse/ActiveRecord
end