parent
e2088407f9
commit
5b4e8a836b
|
@ -16,22 +16,9 @@ import org.quartz.*;
|
||||||
public class TestPlanTestJob extends MsScheduleJob {
|
public class TestPlanTestJob extends MsScheduleJob {
|
||||||
private String projectID;
|
private String projectID;
|
||||||
|
|
||||||
|
|
||||||
// private PerformanceTestService performanceTestService;
|
|
||||||
// private TestPlanScenarioCaseService testPlanScenarioCaseService;
|
|
||||||
// private TestPlanApiCaseService testPlanApiCaseService;
|
|
||||||
// private ApiTestCaseService apiTestCaseService;
|
|
||||||
// private TestPlanReportService testPlanReportService;
|
|
||||||
// private TestPlanLoadCaseService testPlanLoadCaseService;
|
|
||||||
private TestPlanService testPlanService;
|
private TestPlanService testPlanService;
|
||||||
|
|
||||||
public TestPlanTestJob() {
|
public TestPlanTestJob() {
|
||||||
// this.performanceTestService = CommonBeanFactory.getBean(PerformanceTestService.class);
|
|
||||||
// this.testPlanScenarioCaseService = CommonBeanFactory.getBean(TestPlanScenarioCaseService.class);
|
|
||||||
// this.testPlanApiCaseService = CommonBeanFactory.getBean(TestPlanApiCaseService.class);
|
|
||||||
// this.apiTestCaseService = CommonBeanFactory.getBean(ApiTestCaseService.class);
|
|
||||||
// this.testPlanReportService = CommonBeanFactory.getBean(TestPlanReportService.class);
|
|
||||||
// this.testPlanLoadCaseService = CommonBeanFactory.getBean(TestPlanLoadCaseService.class);
|
|
||||||
this.testPlanService = CommonBeanFactory.getBean(TestPlanService.class);
|
this.testPlanService = CommonBeanFactory.getBean(TestPlanService.class);
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,7 +50,16 @@ public class TestPlanTestJob extends MsScheduleJob {
|
||||||
JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
|
JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
|
||||||
String config = jobDataMap.getString("config");
|
String config = jobDataMap.getString("config");
|
||||||
|
|
||||||
testPlanService.run(this.resourceId, this.projectID, this.userId, ReportTriggerMode.SCHEDULE.name(),config);
|
String runResourceId = this.resourceId;
|
||||||
|
String runProjectId = this.projectID;
|
||||||
|
String runUserId = this.userId;
|
||||||
|
Thread thread = new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
testPlanService.run(runResourceId, runProjectId, runUserId, ReportTriggerMode.SCHEDULE.name(),config);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
thread.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JobKey getJobKey(String testId) {
|
public static JobKey getJobKey(String testId) {
|
||||||
|
|
|
@ -69,7 +69,8 @@ public class AppStartListener implements ApplicationListener<ApplicationReadyEve
|
||||||
|
|
||||||
@Value("${jmeter.home}")
|
@Value("${jmeter.home}")
|
||||||
private String jmeterHome;
|
private String jmeterHome;
|
||||||
|
@Value("${quartz.properties.org.quartz.jobStore.acquireTriggersWithinLock}")
|
||||||
|
private String acquireTriggersWithinLock;
|
||||||
@Value("${quartz.enabled}")
|
@Value("${quartz.enabled}")
|
||||||
private boolean quartzEnable;
|
private boolean quartzEnable;
|
||||||
@Value("${quartz.scheduler-name}")
|
@Value("${quartz.scheduler-name}")
|
||||||
|
@ -101,6 +102,7 @@ public class AppStartListener implements ApplicationListener<ApplicationReadyEve
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
LogUtil.info("开始启动定时任务。 相关设置:" +
|
LogUtil.info("开始启动定时任务。 相关设置:" +
|
||||||
|
"quartz.acquireTriggersWithinLock :" + acquireTriggersWithinLock + "\r\n" +
|
||||||
"quartz.enabled :" + quartzEnable + "\r\n" +
|
"quartz.enabled :" + quartzEnable + "\r\n" +
|
||||||
"quartz.scheduler-name :" + quartzScheduleName + "\r\n" +
|
"quartz.scheduler-name :" + quartzScheduleName + "\r\n" +
|
||||||
"quartz.thread-count :" + quartzThreadCount + "\r\n");
|
"quartz.thread-count :" + quartzThreadCount + "\r\n");
|
||||||
|
|
|
@ -92,7 +92,8 @@ jmeter.home=/opt/jmeter
|
||||||
# quartz
|
# quartz
|
||||||
quartz.enabled=true
|
quartz.enabled=true
|
||||||
quartz.scheduler-name=msServerJob
|
quartz.scheduler-name=msServerJob
|
||||||
quartz.thread-count=30
|
quartz.thread-count=60
|
||||||
|
quartz.properties.org.quartz.jobStore.acquireTriggersWithinLock=true
|
||||||
# file upload
|
# file upload
|
||||||
spring.servlet.multipart.max-file-size=500MB
|
spring.servlet.multipart.max-file-size=500MB
|
||||||
spring.servlet.multipart.max-request-size=500MB
|
spring.servlet.multipart.max-request-size=500MB
|
||||||
|
|
Loading…
Reference in New Issue