导入gitee issue,已执行页码参数

This commit is contained in:
xxq250 2023-03-22 17:50:42 +08:00
parent 7cc0dfd08d
commit f44c244015
1 changed files with 6 additions and 6 deletions

View File

@ -5,17 +5,17 @@ namespace :batch_add_issues do
puts "project_id=================#{project_id}"
next if project_id.blank?
project = Project.find project_id
# count = 100000
# if ENV['count'].present?
# count = ENV['count']
# end
count = 0
if ENV['count'].present?
count = ENV['count']
end
total_count = 2066 + 499 + 16675 + 451
puts "total_count==========#{total_count}"
if total_count > 100
total_page = (total_count / 100) + 1
total_page.times do |i|
add_issues_to_project(project, i + 1)
add_issues_to_project(project, i + 1 + count)
end
else
add_issues_to_project(project, 1)
@ -50,7 +50,7 @@ namespace :batch_add_issues do
issue_updated_at = issue['updated_at']
user = User.find_by(login: user_login)
unless user.present?
username = user_login
username = user_login[0..28]
email = "#{username}@gitlink.org.cn"
phone = ""
password = "a12345678"