| @@ -1,9 +1,9 @@ | |||||
| require 'uri' | |||||
| require 'net/http' | |||||
| class SyncProjectsJob < ApplicationJob | class SyncProjectsJob < ApplicationJob | ||||
| queue_as :default | queue_as :default | ||||
| require 'uri' | |||||
| require 'net/http' | |||||
| def perform(sync_params) | def perform(sync_params) | ||||
| SyncLog.sync_log("==========begin to sync #{sync_params[:type]} to forge============") | SyncLog.sync_log("==========begin to sync #{sync_params[:type]} to forge============") | ||||
| begin | begin | ||||
| @@ -41,6 +41,8 @@ class SyncProjectsJob < ApplicationJob | |||||
| end | end | ||||
| end | end | ||||
| private | |||||
| def update_new_project(re, project_id) | def update_new_project(re, project_id) | ||||
| project = Project.find_by(id: project_id) | project = Project.find_by(id: project_id) | ||||
| project.update(re[:target_params].compact!) if re[:target_params].present? | project.update(re[:target_params].compact!) if re[:target_params].present? | ||||