Welcome to mirror list, hosted at ThFree Co, Russian Federation.

expire_job_cache_worker.rb « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 49f0222e9c94266877267106e702c0169ce52a69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

class ExpireJobCacheWorker # rubocop:disable Scalability/IdempotentWorker
  include ApplicationWorker

  data_consistency :delayed

  sidekiq_options retry: 3
  include PipelineQueue

  queue_namespace :pipeline_cache
  urgency :high

  deduplicate :until_executing, including_scheduled: true
  idempotent!

  def perform(job_id)
    job = CommitStatus.find_by_id(job_id)
    return unless job

    job.expire_etag_cache!
    ExpirePipelineCacheWorker.perform_async(job.pipeline_id)
  end
end