Commit d122225a authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'add-if_deduplicated-option-to-assign-resource-group-worker' into 'master'

Add reschedule option to Resource Group worker

See merge request gitlab-org/gitlab!72961
parents ab328388 63cc1946
...@@ -21,7 +21,7 @@ module Ci ...@@ -21,7 +21,7 @@ module Ci
# Therefore, we can deduplicate the sidekiq jobs until the on-going # Therefore, we can deduplicate the sidekiq jobs until the on-going
# assignment process has been finished. # assignment process has been finished.
idempotent! idempotent!
deduplicate :until_executed deduplicate :until_executed, if_deduplicated: :reschedule_once
def perform(resource_group_id) def perform(resource_group_id)
::Ci::ResourceGroup.find_by_id(resource_group_id).try do |resource_group| ::Ci::ResourceGroup.find_by_id(resource_group_id).try do |resource_group|
......
...@@ -9,6 +9,10 @@ RSpec.describe Ci::ResourceGroups::AssignResourceFromResourceGroupWorker do ...@@ -9,6 +9,10 @@ RSpec.describe Ci::ResourceGroups::AssignResourceFromResourceGroupWorker do
expect(described_class.get_deduplicate_strategy).to eq(:until_executed) expect(described_class.get_deduplicate_strategy).to eq(:until_executed)
end end
it 'has an option to reschedule once if deduplicated' do
expect(described_class.get_deduplication_options).to include({ if_deduplicated: :reschedule_once })
end
describe '#perform' do describe '#perform' do
subject { worker.perform(resource_group_id) } subject { worker.perform(resource_group_id) }
......
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