Commit 656b4bbd authored by Alexandru Croitor's avatar Alexandru Croitor

Set deduplicate strategy to untill_executed

IssuePlacementWorker is being invoked on every issue creation.
If a project creates multiple issues in a very short time, the
IssuePlacementWorker can be invoked multiple times for the same
project. Avoid that by deduplicating the job through
untill_executed strategy.
parent f4865940
...@@ -4,6 +4,7 @@ class IssuePlacementWorker ...@@ -4,6 +4,7 @@ class IssuePlacementWorker
include ApplicationWorker include ApplicationWorker
idempotent! idempotent!
deduplicate :until_executed, including_scheduled: true
feature_category :issue_tracking feature_category :issue_tracking
urgency :high urgency :high
worker_resource_boundary :cpu worker_resource_boundary :cpu
......
...@@ -129,4 +129,9 @@ RSpec.describe IssuePlacementWorker do ...@@ -129,4 +129,9 @@ RSpec.describe IssuePlacementWorker do
it_behaves_like 'running the issue placement worker' it_behaves_like 'running the issue placement worker'
end end
end end
it 'has the `until_executed` deduplicate strategy' do
expect(described_class.get_deduplicate_strategy).to eq(:until_executed)
expect(described_class.get_deduplication_options).to include({ including_scheduled: true })
end
end end
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