forked from github/dataease
Merge pull request #11947 from dataease/pr@dev-v2@perf_threshold_task
perf(X-Pack): 阈值告警任务
This commit is contained in:
commit
94dd0f1717
@ -36,18 +36,15 @@ public class DeTaskExecutor {
|
||||
public void init() {
|
||||
}
|
||||
|
||||
public void addThresholdTask(Long taskId, String cron, Long startTime, Long endTime) {
|
||||
public void addThresholdTask(Long taskId, String cron) {
|
||||
String key = taskId.toString();
|
||||
JobKey jobKey = new JobKey(key, THRESHOLD_JOB_GROUP);
|
||||
TriggerKey triggerKey = new TriggerKey(key, THRESHOLD_JOB_GROUP);
|
||||
JobDataMap jobDataMap = new JobDataMap();
|
||||
jobDataMap.put("taskId", taskId);
|
||||
jobDataMap.put("threshold", taskId);
|
||||
Date end = null;
|
||||
if (ObjectUtils.isNotEmpty(endTime)) end = new Date(endTime);
|
||||
Date startDate = new Date();
|
||||
if (ObjectUtils.isNotEmpty(startTime)) startDate = new Date(startTime);
|
||||
scheduleManager.addOrUpdateCronJob(jobKey, triggerKey, DeXpackScheduleJob.class, cron, startDate, end, jobDataMap);
|
||||
scheduleManager.addOrUpdateCronJob(jobKey, triggerKey, DeXpackScheduleJob.class, cron, startDate, null, jobDataMap);
|
||||
}
|
||||
|
||||
public void addOrUpdateTask(Long taskId, String cron, Long startTime, Long endTime) {
|
||||
|
2
de-xpack
2
de-xpack
@ -1 +1 @@
|
||||
Subproject commit 2e0b320c998bdb2ba7962de4c73d11f69b34735c
|
||||
Subproject commit 2378ae36e6b40ed9dbf0c5f7d3c6b744abb541ff
|
Loading…
Reference in New Issue
Block a user