|
|
|
@@ -144,7 +144,7 @@ namespace :batch_add_issues do |
|
|
|
if total_count > 100 |
|
|
|
total_page = (total_count / 100) + 1 |
|
|
|
total_page.times do |i| |
|
|
|
sleep 3.seconds |
|
|
|
sleep 1.seconds |
|
|
|
add_github_issues_to_project(project, i + 1 + count) |
|
|
|
end |
|
|
|
else |
|
|
|
@@ -160,7 +160,7 @@ namespace :batch_add_issues do |
|
|
|
# response = Net::HTTP.get_response(uri) |
|
|
|
http = Net::HTTP.new(uri.hostname, uri.port) |
|
|
|
http.use_ssl = true |
|
|
|
response = http.send_request('GET', uri.path, nil, {'Content-Type' => 'application/json','authorization' => "Bearer #{ENV['token']}"}) |
|
|
|
response = http.send_request('GET', uri, nil, {'Content-Type' => 'application/json','authorization' => "Bearer #{ENV['token']}"}) |
|
|
|
|
|
|
|
puts "gitee api response.code ===== #{response.code}" |
|
|
|
lists = JSON.parse(response.body) |
|
|
|
@@ -230,7 +230,7 @@ namespace :batch_add_issues do |
|
|
|
# comment_response = Net::HTTP.get_response(comment_uri) |
|
|
|
http = Net::HTTP.new(comment_uri.hostname, comment_uri.port) |
|
|
|
http.use_ssl = true |
|
|
|
comment_response = http.send_request('GET', comment_uri.path, nil, {'Content-Type' => 'application/json','authorization' => "Bearer #{ENV['token']}"}) |
|
|
|
comment_response = http.send_request('GET', comment_uri, nil, {'Content-Type' => 'application/json','authorization' => "Bearer #{ENV['token']}"}) |
|
|
|
comment_lists = JSON.parse(comment_response.body) |
|
|
|
|
|
|
|
comment_lists.each do |comment| |
|
|
|
|