mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
FIX merge bug
This commit is contained in:
22
app/jobs/sync_project_military_job.rb
Normal file
22
app/jobs/sync_project_military_job.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
require 'uri'
|
||||
require 'net/http'
|
||||
|
||||
class SyncProjectMilitaryJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(project, repository, project_socre)
|
||||
Rails.logger.info("============begin to sync project ===========")
|
||||
project_except_params = %w(praises_count watchers_count issues_count pull_requests_count versions_count issue_tags_count closed_issues_count)
|
||||
project_params = {
|
||||
project: project.as_json(except: project_except_params),
|
||||
repository: repository.as_json,
|
||||
project_socre: project_socre.as_json
|
||||
}
|
||||
url = "http://47.93.212.82:49999/sync_forges" #trustie上的相关路由
|
||||
uri = URI.parse(url)
|
||||
http = Net::HTTP.new(uri.hostname, uri.port)
|
||||
http.use_ssl = false
|
||||
response = http.send_request('POST', uri.path, project_params.to_json, {'Content-Type' => 'application/json'})
|
||||
Rails.logger.info("============end to sync project, status: #{response.code} ===========")
|
||||
end
|
||||
end
|
||||
@@ -28,6 +28,7 @@ class SyncRepositoryJob < ApplicationJob
|
||||
SyncLog.sync_log("=============force_push_erros==#{path}/#{image_repo_name}++branch:#{branch}")
|
||||
else
|
||||
SyncLog.sync_log("=============force_push_success==#{path}/#{image_repo_name}++branch+++#{branch}")
|
||||
system("rm -rf #{path}/#{image_repo_name}")
|
||||
end
|
||||
end
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user