diff --git a/app/controllers/ob_repository_syncs_controller.rb b/app/controllers/ob_repository_syncs_controller.rb index 87622b90b..0ba17163c 100644 --- a/app/controllers/ob_repository_syncs_controller.rb +++ b/app/controllers/ob_repository_syncs_controller.rb @@ -83,7 +83,8 @@ class ObRepositorySyncsController < ApplicationController service = ObRepositorySync::ApiService.new(@ob_repository_sync.name) res = service.delete_job params[:job_id] tip_exception "保存失败: #{res["msg"]}" if res["code"].to_s != "200" - @ob_repository_sync.destroy! + job = ObRepositorySyncJob.find_by(ob_repository_sync_id: @ob_repository_sync.id, job_id: params[:job_id]) + job.destroy! if job.present? render_ok end