2018-06-27 03:23:28 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-06-14 11:09:48 -04:00
|
|
|
# rubocop: disable Scalability/IdempotentWorker
|
2020-04-21 11:21:10 -04:00
|
|
|
class ExpirePipelineCacheWorker
|
2017-11-28 11:08:30 -05:00
|
|
|
include ApplicationWorker
|
2021-04-30 14:10:09 -04:00
|
|
|
|
|
|
|
sidekiq_options retry: 3
|
2017-04-18 15:26:56 -04:00
|
|
|
include PipelineQueue
|
|
|
|
|
2017-11-28 11:16:50 -05:00
|
|
|
queue_namespace :pipeline_cache
|
2020-03-02 13:07:42 -05:00
|
|
|
urgency :high
|
2019-10-30 11:14:17 -04:00
|
|
|
worker_resource_boundary :cpu
|
2021-06-18 05:10:09 -04:00
|
|
|
data_consistency :delayed
|
2017-08-21 08:02:20 -04:00
|
|
|
|
2021-06-14 11:09:48 -04:00
|
|
|
# This worker _should_ be idempotent, but due to us moving this to data_consistency :delayed
|
|
|
|
# and an ongoing incompatibility between the two switches, we need to disable this.
|
|
|
|
# Uncomment once https://gitlab.com/gitlab-org/gitlab/-/issues/325291 is resolved
|
|
|
|
# idempotent!
|
2020-04-21 11:21:10 -04:00
|
|
|
|
2017-04-20 02:44:01 -04:00
|
|
|
def perform(pipeline_id)
|
2021-11-10 10:13:21 -05:00
|
|
|
pipeline = Ci::Pipeline.find_by_id(pipeline_id)
|
2021-02-26 13:11:10 -05:00
|
|
|
return unless pipeline
|
2017-04-21 11:39:19 -04:00
|
|
|
|
2019-04-12 15:29:47 -04:00
|
|
|
Ci::ExpirePipelineCacheService.new.execute(pipeline)
|
2017-04-18 15:26:56 -04:00
|
|
|
end
|
|
|
|
end
|
2021-06-14 11:09:48 -04:00
|
|
|
# rubocop:enable Scalability/IdempotentWorker
|