Commit 00d63de4 authored by Brett Walker's avatar Brett Walker

count the number of specific migration background jobs

parent 8119d7b3
Pipeline #89022 passed with stage
in 22 seconds
......@@ -27,8 +27,12 @@ def cronjob_can_be_disabled(cron_name)
end
def handle_named_set(title, named_set)
background_migrations = {}
queue_sizes = named_set.each_with_object({}) do |job, hash|
hash[job.queue] = (hash[job.queue] || 0) + 1
if job.queue == 'background_migration'
background_migrations[job.args[0]] = (background_migrations[job.args[0]] || 0) + 1
end
end
if !queue_sizes.empty?
......@@ -37,6 +41,9 @@ def handle_named_set(title, named_set)
queue_sizes.each do |k,v|
status = queue_can_be_purged(k) ? " (purged)" : ""
puts " #{k}: #{v}#{status}"
if k == 'background_migration' && !background_migrations.empty?
background_migrations.each { |klass, count| puts " #{klass}: #{count}"}
end
end
end
......
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