change bugs

This commit is contained in:
sylor_huang@126.com 2020-07-09 20:24:02 +08:00
parent f3392e0aeb
commit e06a2ec0f0
1 changed files with 5 additions and 5 deletions

View File

@ -4,14 +4,13 @@ class SyncForgeController < ApplicationController
def create
ActiveRecord::Base.transaction do
sync_params = params[:sync_params]
#以前已同步的项目,那么肯定存在仓库
if Project.exists?(id: sync_params[:id], identifier: sync_params[:identifier])
Rails.logger.info("=================begin_to_update_project========")
project = Project.find_by(id: sync_params[:id])
check_sync_project(project, sync_params)
else #新建项目
Rails.logger.info("=================begin_to_create_new_project========")
project_user = User.where(login: sync_params[:owner_login]).first
project_params = {
identifier: sync_params[:identifier],
@ -24,9 +23,10 @@ class SyncForgeController < ApplicationController
SyncRepositoryJob.perform_later(project.repository, sync_params[:repository_params]) if sync_params[:repository_params]
check_new_project(project, sync_params)
end
rescue Exception => e
Rails.logger.info("========has_errors:==#{e}====")
end
end
rescue Exception => e
SyncLog.sync_log("=================has_errors:==#{e}")
end
def sync_users