fix(定时任务配置): 增加Quartz的acquireTriggersWithinLock配置

增加Quartz的acquireTriggersWithinLock配置
This commit is contained in:
song-tianyang 2021-12-16 10:34:03 +08:00 committed by song-tianyang
parent 4dcdbce306
commit c8f887019d
3 changed files with 5 additions and 3 deletions

View File

@ -2,7 +2,6 @@ package io.metersphere.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.api.service.ApiAutomationService;
import io.metersphere.base.domain.Schedule;
import io.metersphere.controller.request.QueryScheduleRequest;
import io.metersphere.controller.request.ScheduleRequest;
@ -18,8 +17,6 @@ import java.util.List;
public class ScheduleController {
@Resource
private ScheduleService scheduleService;
@Resource
private ApiAutomationService apiAutomationService;
@PostMapping("/list/{goPage}/{pageSize}")
public List<ScheduleDao> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryScheduleRequest request) {

View File

@ -70,6 +70,9 @@ public class AppStartListener implements ApplicationListener<ApplicationReadyEve
@Value("${jmeter.home}")
private String jmeterHome;
@Value("${quartz.properties.org.quartz.jobStore.acquireTriggersWithinLock}")
private String acquireTriggersWithinLock;
@Override
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
@ -94,6 +97,7 @@ public class AppStartListener implements ApplicationListener<ApplicationReadyEve
e.printStackTrace();
}
LogUtil.info("开始启动定时任务。 定时任务 acquireTriggersWithinLock 设置:"+acquireTriggersWithinLock);
scheduleService.startEnableSchedules();
}

View File

@ -93,6 +93,7 @@ jmeter.home=/opt/jmeter
quartz.enabled=true
quartz.scheduler-name=msServerJob
quartz.thread-count=30
quartz.properties.org.quartz.jobStore.acquireTriggersWithinLock=true
# file upload
spring.servlet.multipart.max-file-size=500MB
spring.servlet.multipart.max-request-size=500MB