From e7aa05b5359b09d3cabe40edc5f7b28c65a5e9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxxq250=E2=80=9D?= <“xxq250@qq.com”> Date: Fri, 5 Aug 2022 13:48:40 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20reposyncer=20=E5=88=A0=E9=99=A4job?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/ob_repository_syncs_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/ob_repository_syncs_controller.rb b/app/controllers/ob_repository_syncs_controller.rb index 87622b90..0ba17163 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