Github issues迁移,用户名处理, 限流需要请求等待,token

This commit is contained in:
xxq250 2023-12-15 17:04:53 +08:00
parent de393148d9
commit b80ed537fc
1 changed files with 3 additions and 3 deletions

View File

@ -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|