blob: cd5ca25f031a06f274f3b7f5cf54501b0ba90ae1 (
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
25
26
27
28
29
30
31
32
33
|
# frozen_string_literal: true
class ExpireJobCacheWorker
include ApplicationWorker
data_consistency :always
sidekiq_options retry: 3
include PipelineQueue
queue_namespace :pipeline_cache
urgency :high
idempotent!
# rubocop: disable CodeReuse/ActiveRecord
def perform(job_id)
job = CommitStatus.eager_load_pipeline.find_by(id: job_id)
return unless job
pipeline = job.pipeline
project = job.project
Gitlab::EtagCaching::Store.new.touch(project_job_path(project, job))
ExpirePipelineCacheWorker.perform_async(pipeline.id)
end
# rubocop: enable CodeReuse/ActiveRecord
private
def project_job_path(project, job)
Gitlab::Routing.url_helpers.project_build_path(project, job.id, format: :json)
end
end
|