change bugs
This commit is contained in:
parent
087550797b
commit
77d0b89215
|
@ -4,14 +4,14 @@ class SyncForgeController < ApplicationController
|
||||||
def create
|
def create
|
||||||
ActiveRecord::Base.transaction do
|
ActiveRecord::Base.transaction do
|
||||||
sync_params = params[:sync_params]
|
sync_params = params[:sync_params]
|
||||||
#以前已同步的项目,那么肯定存在仓库,4.20之前
|
#以前已同步的项目,那么肯定存在仓库
|
||||||
if Project.exists?(identifier: sync_params[:identifier])
|
if Project.exists?(id: sync_params[:id], identifier: sync_params[:identifier])
|
||||||
Rails.logger.info("=================begin_to_update_project========")
|
Rails.logger.info("=================begin_to_update_project========")
|
||||||
project = Project.where(identifier: sync_params[:identifier])&.first
|
project = Project.find_by(id: sync_params[:id])
|
||||||
Rails.logger.info("--------project_id:#{project.id}---------------")
|
Rails.logger.info("--------project_id:#{project.id}---------------")
|
||||||
check_sync_project(project, sync_params) if project.present?
|
check_sync_project(project, sync_params)
|
||||||
else #新建项目
|
else #新建项目
|
||||||
Rails.logger.info("=================begin_to_create_new_project========")
|
Rails.logger.info("=================begin_to_create_new_project========")
|
||||||
project_user = User.where(login: sync_params[:owner_login]).first
|
project_user = User.where(login: sync_params[:owner_login]).first
|
||||||
project_params = {
|
project_params = {
|
||||||
repository_name: sync_params[:identifier],
|
repository_name: sync_params[:identifier],
|
||||||
|
@ -184,6 +184,7 @@ class SyncForgeController < ApplicationController
|
||||||
}
|
}
|
||||||
SyncProjectsJob.perform_later(sync_projects_params)
|
SyncProjectsJob.perform_later(sync_projects_params)
|
||||||
Rails.logger.info("***5. begin_to_sync_watchers---------------")
|
Rails.logger.info("***5. begin_to_sync_watchers---------------")
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -221,7 +222,6 @@ class SyncForgeController < ApplicationController
|
||||||
|
|
||||||
def check_token
|
def check_token
|
||||||
sync_params = params[:sync_params]
|
sync_params = params[:sync_params]
|
||||||
Rails.logger.info("=======is_token:#{sync_params[:token] == get_token}=====================")
|
|
||||||
unless sync_params[:token] && sync_params[:token] == get_token
|
unless sync_params[:token] && sync_params[:token] == get_token
|
||||||
render json: {message: "token_errors"}
|
render json: {message: "token_errors"}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue