Class: ExpireJobCacheWorker

Inherits:
Object
  • Object
show all
Includes:
ApplicationWorker, PipelineQueue
Defined in:
app/workers/expire_job_cache_worker.rb

Constant Summary

Constants included from ApplicationWorker

ApplicationWorker::LOGGING_EXTRA_KEY

Constants included from WorkerAttributes

WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES

Instance Method Summary collapse

Methods included from Gitlab::SidekiqVersioning::Worker

#job_version

Methods included from WorkerContext

#with_context

Instance Method Details

#perform(job_id) ⇒ Object

rubocop: disable CodeReuse/ActiveRecord


12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/workers/expire_job_cache_worker.rb', line 12

def perform(job_id)
  job = CommitStatus.joins(:pipeline, :project).find_by(id: job_id)
  return unless job

  pipeline = job.pipeline
  project = job.project

  Gitlab::EtagCaching::Store.new.tap do |store|
    store.touch(project_pipeline_path(project, pipeline))
    store.touch(project_job_path(project, job))
  end
end