change bugs
This commit is contained in:
parent
65b03f7c71
commit
e0d9bfab6d
|
@ -14,7 +14,6 @@ class SyncProjectsJob < ApplicationJob
|
||||||
"sync_params": sync_params
|
"sync_params": sync_params
|
||||||
}
|
}
|
||||||
uri = URI.parse(url)
|
uri = URI.parse(url)
|
||||||
if api_host
|
|
||||||
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('GET', uri.path, sync_params, {'Content-Type' => 'application/json'})
|
response = http.send_request('GET', uri.path, sync_params, {'Content-Type' => 'application/json'})
|
||||||
|
@ -30,7 +29,6 @@ class SyncProjectsJob < ApplicationJob
|
||||||
else
|
else
|
||||||
SyncLog.sync_log("==========sync_project_to_forge_failed #{sync_params[:type]}============")
|
SyncLog.sync_log("==========sync_project_to_forge_failed #{sync_params[:type]}============")
|
||||||
end
|
end
|
||||||
end
|
|
||||||
rescue => e
|
rescue => e
|
||||||
SyncLog.sync_log("==========sync_project_to_forge_failed #{sync_params[:type]}============errors:#{e}")
|
SyncLog.sync_log("==========sync_project_to_forge_failed #{sync_params[:type]}============errors:#{e}")
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,6 +6,8 @@ class SyncRepositoryJob < ApplicationJob
|
||||||
def perform(repository, repository_params, gitea_main)
|
def perform(repository, repository_params, gitea_main)
|
||||||
#创建临时文件夹 clone 并强推代码
|
#创建临时文件夹 clone 并强推代码
|
||||||
SyncLog.sync_log("=================begin to sync request trustie repository=====================")
|
SyncLog.sync_log("=================begin to sync request trustie repository=====================")
|
||||||
|
SyncLog.sync_log("=================begin to sync repository_params:==#{repository_params}===================")
|
||||||
|
SyncLog.sync_log("=================repository_url:==#{repository_params[:url]}===================")
|
||||||
path = "#{Rails.root}/public/cache_repository"
|
path = "#{Rails.root}/public/cache_repository"
|
||||||
unless File.directory?(path)
|
unless File.directory?(path)
|
||||||
FileUtils.mkdir_p(path)
|
FileUtils.mkdir_p(path)
|
||||||
|
|
Loading…
Reference in New Issue