From 690ddcb4a7a0467ed1031f9f1e6f2c4424611004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxxq250=E2=80=9D?= <“xxq250@qq.com”> Date: Thu, 4 Aug 2022 17:20:24 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20reposyncer=20=E5=88=86=E6=94=AF?= =?UTF-8?q?=E7=BB=84=E5=90=88=E5=B7=B2=E9=85=8D=E7=BD=AE=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/ob_repository_syncs_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/ob_repository_syncs_controller.rb b/app/controllers/ob_repository_syncs_controller.rb index 9a0471c02..8fd97355a 100644 --- a/app/controllers/ob_repository_syncs_controller.rb +++ b/app/controllers/ob_repository_syncs_controller.rb @@ -56,10 +56,10 @@ class ObRepositorySyncsController < ApplicationController def create_jobs tip_exception "必须配置一个分支" if params[:github_branch].blank? && params[:gitee_branch].blank? && params[:gitlink_branch].blank? ob_jobs = ObRepositorySyncJob.where(ob_repository_sync_id: @ob_repository_sync.id) - ob_jobs.where(job_type: params[:job_type]) if params[:job_type].present? - ob_jobs.where(github_branch: params[:github_branch]) if params[:github_branch].present? - ob_jobs.where(gitee_branch: params[:gitee_branch]) if params[:gitee_branch].present? - ob_jobs.where(gitlink_branch: params[:gitlink_branch]) if params[:gitlink_branch].present? + ob_jobs = ob_jobs.where(job_type: params[:job_type]) if params[:job_type].present? + ob_jobs = ob_jobs.where(github_branch: params[:github_branch]) if params[:github_branch].present? + ob_jobs = ob_jobs.where(gitee_branch: params[:gitee_branch]) if params[:gitee_branch].present? + ob_jobs = ob_jobs.where(gitlink_branch: params[:gitlink_branch]) if params[:gitlink_branch].present? tip_exception "该分支组合已配置,不能重复!" if ob_jobs.count > 0 service = ObRepositorySync::ApiService.new(@ob_repository_sync.name) res = service.create_projects_jobs(params)