Merge pull request #11947 from dataease/pr@dev-v2@perf_threshold_task

perf(X-Pack): 阈值告警任务
This commit is contained in:
fit2cloud-chenyw
2024-09-03 13:05:07 +08:00
committed by GitHub
2 changed files with 3 additions and 6 deletions

View File

@@ -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) {