Commit 9bbc89cd authored by David Fernandez's avatar David Fernandez

Merge branch 'reduce-euqueue-waiting-times' into 'master'

Decrease enqueue waiting time for registry migration

See merge request gitlab-org/gitlab!85211
parents 7f11b5b8 d1e564ee
......@@ -39,9 +39,9 @@ module ContainerRegistry
def self.enqueue_waiting_time
return 0 if Feature.enabled?(:container_registry_migration_phase2_enqueue_speed_fast)
return 6.hours if Feature.enabled?(:container_registry_migration_phase2_enqueue_speed_slow)
return 165.minutes if Feature.enabled?(:container_registry_migration_phase2_enqueue_speed_slow)
1.hour
45.minutes
end
def self.capacity
......
......@@ -37,8 +37,8 @@ RSpec.describe ContainerRegistry::Migration do
subject { described_class.enqueue_waiting_time }
where(:slow_enabled, :fast_enabled, :expected_result) do
false | false | 1.hour
true | false | 6.hours
false | false | 45.minutes
true | false | 165.minutes
false | true | 0
true | true | 0
end
......
......@@ -141,20 +141,20 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures
with_them do
before do
allow(ContainerRegistry::Migration).to receive(:enqueue_waiting_time).and_return(1.hour)
allow(ContainerRegistry::Migration).to receive(:enqueue_waiting_time).and_return(45.minutes)
create(:container_repository, state, timestamp => 1.minute.ago)
end
it_behaves_like 'no action' do
before do
expect_log_extra_metadata(waiting_time_passed: false, current_waiting_time_setting: 1.hour)
expect_log_extra_metadata(waiting_time_passed: false, current_waiting_time_setting: 45.minutes)
end
end
end
context 'when last completed repository has nil timestamps' do
before do
allow(ContainerRegistry::Migration).to receive(:enqueue_waiting_time).and_return(1.hour)
allow(ContainerRegistry::Migration).to receive(:enqueue_waiting_time).and_return(45.minutes)
create(:container_repository, migration_state: 'import_done')
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