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