diff options
Diffstat (limited to 'lib/tasks/gitlab/db.rake')
-rw-r--r-- | lib/tasks/gitlab/db.rake | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/tasks/gitlab/db.rake b/lib/tasks/gitlab/db.rake index 3a7e53a27e4..068dc463d16 100644 --- a/lib/tasks/gitlab/db.rake +++ b/lib/tasks/gitlab/db.rake @@ -282,7 +282,7 @@ namespace :gitlab do puts "There are #{Gitlab::Database::Reindexing::QueuedAction.queued.size} queued actions in total." end - unless Feature.enabled?(:database_reindexing, type: :ops, default_enabled: :yaml) + unless Feature.enabled?(:database_reindexing, type: :ops) puts <<~NOTE.color(:yellow) Note: database_reindexing feature is currently disabled. @@ -328,6 +328,15 @@ namespace :gitlab do Gitlab::Database::Migrations::Runner.background_migrations.run_jobs(for_duration: duration) end + + desc 'Sample batched background migrations with instrumentation' + task :sample_batched_background_migrations, [:database, :duration_s] => [:environment] do |_t, args| + database_name = args[:database] || 'main' + duration = args[:duration_s]&.to_i&.seconds || 30.minutes # Default of 30 minutes + + Gitlab::Database::Migrations::Runner.batched_background_migrations(for_database: database_name) + .run_jobs(for_duration: duration) + end end desc 'Run all pending batched migrations' |