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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2017-05-22 21:22:50 +0300
committerZ.J. van de Weg <git@zjvandeweg.nl>2017-05-22 23:07:11 +0300
commit336635f283eab06c561134f2147a3bd1983090e1 (patch)
tree60f38b54fdba9da80f2eeca5e02e1b112a6bdcc2 /app/workers
parentda0c543e289ffc2be0b91b3257bab6f1d0d5dac3 (diff)
Test the ExpireJobCacheWorker and related changes
These were untested by the cherry picked commit.
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/expire_job_cache_worker.rb14
1 files changed, 6 insertions, 8 deletions
diff --git a/app/workers/expire_job_cache_worker.rb b/app/workers/expire_job_cache_worker.rb
index e3930ee9d41..08e281e7350 100644
--- a/app/workers/expire_job_cache_worker.rb
+++ b/app/workers/expire_job_cache_worker.rb
@@ -2,15 +2,17 @@ class ExpireJobCacheWorker
include Sidekiq::Worker
include BuildQueue
- def perform(pipeline_id, job_id)
- job = CommitStatus.joins(:pipeline, :project).find_by(id: job)
+ def perform(job_id)
+ job = CommitStatus.joins(:pipeline, :project).find_by(id: job_id)
return unless job
pipeline = job.pipeline
project = job.project
- store.touch(project_pipeline_path(project, pipeline))
- store.touch(project_job_path(project, job))
+ Gitlab::EtagCaching::Store.new.tap do |store|
+ store.touch(project_pipeline_path(project, pipeline))
+ store.touch(project_job_path(project, job))
+ end
end
private
@@ -30,8 +32,4 @@ class ExpireJobCacheWorker
job.id,
format: :json)
end
-
- def store
- @store ||= Gitlab::EtagCaching::Store.new
- end
end