use of com.dtstack.taier.scheduler.druid.DtDruidRemoveAbandoned in project Taier by DTStack.
the class CycleJobBuilder method saveJobGraph.
/**
* 保存生成的jobGraph记录
*/
@Transactional(rollbackFor = Exception.class)
@DtDruidRemoveAbandoned
public boolean saveJobGraph(String triggerDay) {
LOGGER.info("start saveJobGraph to db {}", triggerDay);
// 记录当天job已经生成
String triggerTimeStr = triggerDay + " 00:00:00";
Timestamp timestamp = Timestamp.valueOf(triggerTimeStr);
try {
RetryUtil.executeWithRetry(() -> {
jobGraphTriggerService.addJobTrigger(timestamp);
return null;
}, environmentContext.getBuildJobErrorRetry(), 200, false);
} catch (Exception e) {
LOGGER.error("addJobTrigger triggerTimeStr {} error ", triggerTimeStr, e);
throw new RdosDefineException(e);
}
return true;
}
use of com.dtstack.taier.scheduler.druid.DtDruidRemoveAbandoned in project Taier by DTStack.
the class CycleJobBuilder method savaJobList.
/**
* 保存周期实例
*
* @param scheduleJobDetails 实例详情
*/
@Transactional(rollbackFor = Exception.class)
@DtDruidRemoveAbandoned
public void savaJobList(List<ScheduleJobDetails> scheduleJobDetails) {
List<ScheduleJobDetails> savaJobDetails = Lists.newArrayList();
for (ScheduleJobDetails scheduleJobDetail : scheduleJobDetails) {
savaJobDetails.add(scheduleJobDetail);
List<ScheduleJobDetails> flowBean = scheduleJobDetail.getFlowBean();
if (CollectionUtils.isNotEmpty(flowBean)) {
savaJobDetails.addAll(flowBean);
}
}
scheduleJobService.insertJobList(savaJobDetails, getType());
}
Aggregations