Browse Source

change bugs

tags/v1
sylor_huang@126.com 6 years ago
parent
commit
087550797b
1 changed files with 4 additions and 5 deletions
  1. +4
    -5
      app/controllers/sync_forge_controller.rb

+ 4
- 5
app/controllers/sync_forge_controller.rb View File

@@ -4,12 +4,12 @@ class SyncForgeController < ApplicationController
def create
ActiveRecord::Base.transaction do
sync_params = params[:sync_params]
#以前已同步的项目,那么肯定存在仓库
if Project.exists?(id: sync_params[:id]) || Project.exists?(identifier: sync_params[:identifier])
#以前已同步的项目,那么肯定存在仓库,4.20之前
if Project.exists?(identifier: sync_params[:identifier])
Rails.logger.info("=================begin_to_update_project========")
project = Project.find_by(id: sync_params[:id]) || Project.where(identifier: sync_params[:identifier])&.first
project = Project.where(identifier: sync_params[:identifier])&.first
Rails.logger.info("--------project_id:#{project.id}---------------")
check_sync_project(project, sync_params)
check_sync_project(project, sync_params) if project.present?
else #新建项目
Rails.logger.info("=================begin_to_create_new_project========")
project_user = User.where(login: sync_params[:owner_login]).first
@@ -184,7 +184,6 @@ class SyncForgeController < ApplicationController
}
SyncProjectsJob.perform_later(sync_projects_params)
Rails.logger.info("***5. begin_to_sync_watchers---------------")

end
end



Loading…
Cancel
Save