导入gitee issue,已执行页码参数
This commit is contained in:
parent
7cc0dfd08d
commit
f44c244015
|
@ -5,17 +5,17 @@ namespace :batch_add_issues do
|
||||||
puts "project_id=================#{project_id}"
|
puts "project_id=================#{project_id}"
|
||||||
next if project_id.blank?
|
next if project_id.blank?
|
||||||
project = Project.find project_id
|
project = Project.find project_id
|
||||||
# count = 100000
|
count = 0
|
||||||
# if ENV['count'].present?
|
if ENV['count'].present?
|
||||||
# count = ENV['count']
|
count = ENV['count']
|
||||||
# end
|
end
|
||||||
|
|
||||||
total_count = 2066 + 499 + 16675 + 451
|
total_count = 2066 + 499 + 16675 + 451
|
||||||
puts "total_count==========#{total_count}"
|
puts "total_count==========#{total_count}"
|
||||||
if total_count > 100
|
if total_count > 100
|
||||||
total_page = (total_count / 100) + 1
|
total_page = (total_count / 100) + 1
|
||||||
total_page.times do |i|
|
total_page.times do |i|
|
||||||
add_issues_to_project(project, i + 1)
|
add_issues_to_project(project, i + 1 + count)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
add_issues_to_project(project, 1)
|
add_issues_to_project(project, 1)
|
||||||
|
@ -50,7 +50,7 @@ namespace :batch_add_issues do
|
||||||
issue_updated_at = issue['updated_at']
|
issue_updated_at = issue['updated_at']
|
||||||
user = User.find_by(login: user_login)
|
user = User.find_by(login: user_login)
|
||||||
unless user.present?
|
unless user.present?
|
||||||
username = user_login
|
username = user_login[0..28]
|
||||||
email = "#{username}@gitlink.org.cn"
|
email = "#{username}@gitlink.org.cn"
|
||||||
phone = ""
|
phone = ""
|
||||||
password = "a12345678"
|
password = "a12345678"
|
||||||
|
|
Loading…
Reference in New Issue