Change
This commit is contained in:
parent
98da7ea34d
commit
271699daf1
|
@ -5,16 +5,16 @@ class SyncForgeProjectsRake
|
||||||
# 运行示例: 检查哪些项目的repo不存在,bundle exec rails runner "SyncForgeProjectsRake.new.call(5)"
|
# 运行示例: 检查哪些项目的repo不存在,bundle exec rails runner "SyncForgeProjectsRake.new.call(5)"
|
||||||
|
|
||||||
def call(count)
|
def call(count)
|
||||||
|
|
||||||
url = "https://forgeplus.trustie.net/api/sync_forge/sync_range_projects" #trustie上的相关路由
|
url = "https://forgeplus.trustie.net/api/sync_forge/sync_range_projects" #trustie上的相关路由
|
||||||
count_params = {
|
count_params = {
|
||||||
sync_count: count || 10
|
sync_count: count || 10
|
||||||
}
|
}
|
||||||
|
Rails.logger.info("============begin to sync project,count: #{count_params} ===========")
|
||||||
uri = URI.parse(url)
|
uri = URI.parse(url)
|
||||||
http = Net::HTTP.new(uri.hostname, uri.port)
|
http = Net::HTTP.new(uri.hostname, uri.port)
|
||||||
http.use_ssl = true
|
http.use_ssl = true
|
||||||
response = http.send_request('POST', uri.path, count_params.to_json, {'Content-Type' => 'application/json'})
|
response = http.send_request('POST', uri.path, count_params.to_json, {'Content-Type' => 'application/json'})
|
||||||
Rails.logger.info("============end to sync project, status: #{response.code} ===========")
|
Rails.logger.info("============end to sync project, status: #{response.code} ===========")
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue