不同版本的 GitLab 检测后台数据迁移任务的命令是不同的,这里为您整理如下:
14 =< Version
gitlab-psql
select job_class_name, table_name, column_name, job_arguments from batched_background_migrations where status <> 3;
12.9 =< Version < 14
gitlab-rails runner -e production 'puts Gitlab::BackgroundMigration.remaining'
Version < 12.9
gitlab-rails console
puts Sidekiq::Queue.new("background_migration").size
Sidekiq::ScheduledSet.new.select { |r| r.klass == 'BackgroundMigrationWorker' }.size