From 7d39a9228bed04ff504def10fe94421e98a8df79 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 24 Dec 2021 11:56:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=89=A7=E8=A1=8C=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/job/sechedule/ApiScenarioTestJob.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/job/sechedule/ApiScenarioTestJob.java b/backend/src/main/java/io/metersphere/job/sechedule/ApiScenarioTestJob.java index 5907a4c3a0..5d30e4a8ed 100644 --- a/backend/src/main/java/io/metersphere/job/sechedule/ApiScenarioTestJob.java +++ b/backend/src/main/java/io/metersphere/job/sechedule/ApiScenarioTestJob.java @@ -9,6 +9,7 @@ import io.metersphere.commons.constants.ReportTriggerMode; import io.metersphere.commons.constants.ScheduleGroup; import io.metersphere.commons.utils.CommonBeanFactory; import io.metersphere.commons.utils.LogUtil; +import io.metersphere.constants.RunModeConstants; import io.metersphere.dto.RunModeConfigDTO; import org.apache.commons.lang3.StringUtils; import org.quartz.*; @@ -26,7 +27,7 @@ import java.util.UUID; */ public class ApiScenarioTestJob extends MsScheduleJob { - private String projectID; + private String projectID; private List scenarioIds; @@ -67,12 +68,15 @@ public class ApiScenarioTestJob extends MsScheduleJob { request.setIds(this.scenarioIds); request.setReportUserID(this.userId); request.setRunMode(ApiRunMode.SCHEDULE_SCENARIO.name()); - JobDataMap jobDataMap = context.getJobDetail().getJobDataMap(); String config = jobDataMap.getString("config"); if (StringUtils.isNotBlank(config)) { RunModeConfigDTO runModeConfig = JSONObject.parseObject(config, RunModeConfigDTO.class); request.setConfig(runModeConfig); + } else { + RunModeConfigDTO runModeConfigDTO = new RunModeConfigDTO(); + runModeConfigDTO.setMode(RunModeConstants.PARALLEL.toString()); + request.setConfig(runModeConfigDTO); } apiAutomationService.run(request);