Commit ebe9bd9c authored by Gabriel Mazetto's avatar Gabriel Mazetto

Use progressbar with `geo:git:housekeeping:*`

parent e82cf566
namespace :geo do
namespace :git do
namespace :housekeeping do
using ProgressBar::Refinements::Enumerator
desc "GitLab | Git | Housekeeping | Garbage Collection"
task gc: :gitlab_environment do
flag_for_housekeeping(Gitlab::CurrentSettings.housekeeping_gc_period)
......@@ -17,7 +19,7 @@ namespace :geo do
end
def flag_for_housekeeping(period)
Geo::ProjectRegistry.select(:id, :project_id).find_in_batches do |batches|
Geo::ProjectRegistry.select(:id, :project_id).find_in_batches.with_progressbar(format: '%t: |%B| %p%% %e') do |batches|
batches.each do |registry|
registry.set_syncs_since_gc!(period - 1)
end
......
......@@ -14,6 +14,7 @@ describe 'geo:git:housekeeping' do
before do
Rake.application.rake_require 'tasks/geo/git'
silence_progress_bar
end
after do
......
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