From bdee2d7776baf88dc4021369350eeb37405fe5cf Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Mon, 25 Jul 2022 17:16:54 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E5=9C=BA=E6=99=AF=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/api/service/ApiAutomationService.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java index 8a00c5dd25..a4d183c251 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -63,8 +63,6 @@ import org.apache.ibatis.session.SqlSessionFactory; import org.apache.jorphan.collections.HashTree; import org.apache.jorphan.collections.ListedHashTree; import org.mybatis.spring.SqlSessionUtils; -import org.quartz.JobKey; -import org.quartz.TriggerKey; import org.springframework.context.annotation.Lazy; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -1091,13 +1089,7 @@ public class ApiAutomationService { } public void updateSchedule(Schedule request) { - scheduleService.editSchedule(request); - JobKey jobKey = ApiScenarioTestJob.getJobKey(request.getResourceId()); - TriggerKey triggerKey = ApiScenarioTestJob.getTriggerKey(request.getResourceId()); - Class clazz = ApiScenarioTestJob.class; - request.setJob(ApiScenarioTestJob.class.getName()); - this.addOrUpdateApiScenarioCronJob(request); - scheduleService.resetJob(request, jobKey, triggerKey, clazz); + scheduleService.updateSchedule(request); } private void addOrUpdateApiScenarioCronJob(Schedule request) {