This commit is contained in:
yystopf 2024-04-25 17:04:39 +08:00
parent d5f841441b
commit 1c1cceabbe
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ class Api::V1::Projects::SyncRepositoriesController < Api::V1::BaseController
params[:sync_repository_ids].split(",").each do |id|
repo = SyncRepository.find_by_id id
Reposync::CreateSyncBranchService.call(repo.repo_name, params[:gitlink_branch_name], params[:external_branch_name])
branch = Reposync::CreateSyncBranchService.call(repo.repo_name, params[:gitlink_branch_name], params[:external_branch_name])
return render_error(branch[2]) if branch[0].to_i !=0
sync_branch = SyncRepositoryBranch.create!(sync_repository_id: id, gitlink_branch_name: params[:gitlink_branch_name], external_branch_name: params[:external_branch_name], reposync_branch_id: branch[1]['id'])
TouchSyncJob.perform_later(sync_branch) if params[:first_sync_direction].to_i == repo.sync_direction