Commit 85da405b authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'ab/reindex-cron-prep' into 'master'

Add feature flag for database reindexing

See merge request gitlab-org/gitlab!42705
parents 27fda022 2f91804d
---
name: database_reindexing
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/42705
rollout_issue_url:
group: group::database
type: ops
default_enabled: false
\ No newline at end of file
......@@ -169,6 +169,11 @@ namespace :gitlab do
desc 'reindex a regular (non-unique) index without downtime to eliminate bloat'
task :reindex, [:index_name] => :environment do |_, args|
unless Feature.enabled?(:database_reindexing, type: :ops)
puts "This feature (database_reindexing) is currently disabled.".yellow
exit
end
raise ArgumentError, 'must give the index name to reindex' unless args[:index_name]
Gitlab::Database::ConcurrentReindex.new(args[:index_name], logger: Logger.new(STDOUT)).execute
......
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