f1f7bfc06f
These tasks are happening through housekeeping right now, by default
ever 10th push. This removes the need for these tasks.
Side note, this removes one of my first contributions to GitLab, as back
than I introduced these tasks through: 54e6c0045b
Closes https://gitlab.com/gitlab-org/gitaly/issues/768
25 lines
672 B
Ruby
25 lines
672 B
Ruby
namespace :gitlab do
|
|
namespace :git do
|
|
desc 'GitLab | Git | Check all repos integrity'
|
|
task fsck: :gitlab_environment do
|
|
failures = []
|
|
Project.find_each(batch_size: 100) do |project|
|
|
begin
|
|
project.repository.fsck
|
|
|
|
rescue => e
|
|
failures << "#{project.full_path} on #{project.repository_storage}: #{e}"
|
|
end
|
|
|
|
puts "Performed integrity check for #{project.repository.full_path}"
|
|
end
|
|
|
|
if failures.empty?
|
|
puts "Done".color(:green)
|
|
else
|
|
puts "The following repositories reported errors:".color(:red)
|
|
failures.each { |f| puts "- #{f}" }
|
|
end
|
|
end
|
|
end
|
|
end
|