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
commit 94dd0f1717
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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) {

@ -1 +1 @@
Subproject commit 2e0b320c998bdb2ba7962de4c73d11f69b34735c
Subproject commit 2378ae36e6b40ed9dbf0c5f7d3c6b744abb541ff