2018-11-08 19:23:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-11-11 11:23:49 +05:30
|
|
|
class ExpireJobCacheWorker # rubocop:disable Scalability/IdempotentWorker
|
2018-03-17 18:26:18 +05:30
|
|
|
include ApplicationWorker
|
2021-06-08 01:23:25 +05:30
|
|
|
|
2021-11-11 11:23:49 +05:30
|
|
|
data_consistency :delayed
|
2021-10-27 15:23:28 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
sidekiq_options retry: 3
|
2018-03-17 18:26:18 +05:30
|
|
|
include PipelineQueue
|
|
|
|
|
|
|
|
queue_namespace :pipeline_cache
|
2020-04-08 14:13:33 +05:30
|
|
|
urgency :high
|
2021-11-18 22:05:49 +05:30
|
|
|
idempotent!
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
def perform(job_id)
|
2022-01-26 12:08:38 +05:30
|
|
|
job = CommitStatus.find_by_id(job_id)
|
2017-08-17 22:00:37 +05:30
|
|
|
return unless job
|
|
|
|
|
2022-01-26 12:08:38 +05:30
|
|
|
job.expire_etag_cache!
|
|
|
|
ExpirePipelineCacheWorker.perform_async(job.pipeline_id)
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
end
|