Commit b9672d4b authored by Stan Hu's avatar Stan Hu

Limit the number of merge requests per project to avoid long seeds

This step was taking a long time because seed_fu creates N / 2 merge requests
for each repo, where N is the number of branches for that repo. At the time of
this writing, there are 234 branches on the gitlab-ce repo, leading to 117
merge requests.
parent 1a9d5059
Gitlab::Seeder.quiet do
# Limit the number of merge requests per project to avoid long seeds
MAX_NUM_MERGE_REQUESTS = 10
Project.all.reject(&:empty_repo?).each do |project|
branches = project.repository.branch_names
branches = project.repository.branch_names.sample(MAX_NUM_MERGE_REQUESTS * 2)
branches.each do |branch_name|
break if branches.size < 2
......
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