Commit c9d4f97f authored by Valery Sizov's avatar Valery Sizov

ES: gitlab:elastic:index_repositories handles errors and shows progress

parent aa6ac83e
v 8.5.0 (unreleased) v 8.5.0 (unreleased)
v 8.4.2
- Rake task gitlab:elastic:index_repositories handles errors and shows progress
v 8.4.1 v 8.4.1
- No EE-specific changes - No EE-specific changes
......
...@@ -2,7 +2,21 @@ namespace :gitlab do ...@@ -2,7 +2,21 @@ namespace :gitlab do
namespace :elastic do namespace :elastic do
desc "Indexing repositories" desc "Indexing repositories"
task index_repositories: :environment do task index_repositories: :environment do
Repository.import Repository.__elasticsearch__.create_index!
Project.find_each do |project|
if project.repository.exists? && !project.repository.empty?
puts "Indexing #{project.name_with_namespace}..."
begin
project.repository.index_commits
project.repository.index_blobs
puts "Done!".green
rescue StandardError => e
puts "#{e.message}, trace - #{e.backtrace}"
end
end
end
end end
desc "Indexing all wikis" desc "Indexing all wikis"
......
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