Skip to content
Snippets Groups Projects
Commit c67db6ff authored by Andreas Brandl's avatar Andreas Brandl
Browse files

Output job statistics in bg migration

parent 6196f2de
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -37,7 +37,11 @@ def schedule_backfill_project_boards
delay = index * DELAY
 
migrate_in(delay, MIGRATION, ['project', 'up', *range])
increment_job_counter!
end
report_and_reset_job_counter!
end
 
def schedule_backfill_group_boards
Loading
Loading
@@ -46,6 +50,30 @@ def schedule_backfill_group_boards
delay = index * DELAY
 
migrate_in(delay, MIGRATION, ['group', 'up', *range])
increment_job_counter!
end
report_and_reset_job_counter!
end
def increment_job_counter!
@job_counter = (job_counter + 1)
end
def job_counter
@job_counter ||= 0
end
def report_and_reset_job_counter!
duration = DELAY * job_counter
say <<~SAY
Scheduled #{job_counter} #{MIGRATION} jobs with an interval of #{DELAY} seconds.
The migration is expected to take at least #{duration} seconds. Expect all jobs to have completed after #{Time.zone.now + duration}."
SAY
@job_counter = 0
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment