Commit 07a584da authored by David Fernandez's avatar David Fernandez

Merge branch '341377-enable-idempotency-for-expire-job-cache-worker' into 'master'

Enable deduplication for ExpireJobCacheWorker

See merge request gitlab-org/gitlab!71199
parents 0335e0c4 43bbe885
......@@ -1427,7 +1427,7 @@
:urgency: :high
:resource_boundary: :unknown
:weight: 3
:idempotent:
:idempotent: true
:tags: []
- :name: pipeline_cache:expire_pipeline_cache
:worker_name: ExpirePipelineCacheWorker
......
......@@ -10,11 +10,9 @@ class ExpireJobCacheWorker # rubocop:disable Scalability/IdempotentWorker
queue_namespace :pipeline_cache
urgency :high
# This worker should be idempotent, but we're switching to data_consistency
# :sticky and there is an ongoing incompatibility, so it needs to be disabled for
# now. The following line can be uncommented and this comment removed once
# https://gitlab.com/gitlab-org/gitlab/-/issues/325291 is resolved.
# idempotent!
deduplicate :until_executing, including_scheduled: true
idempotent!
# rubocop: disable CodeReuse/ActiveRecord
def perform(job_id)
......
......@@ -13,6 +13,8 @@ RSpec.describe ExpireJobCacheWorker do
let(:job_args) { job.id }
it_behaves_like 'an idempotent worker'
it_behaves_like 'worker with data consistency',
described_class,
data_consistency: :delayed
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment