feat(sj_1.0.0): 定时任务超时检查添加500 buff

This commit is contained in:
opensnail 2024-05-22 17:19:22 +08:00
parent 559af38022
commit 03494bb020

View File

@ -159,7 +159,8 @@ public class JobExecutorActor extends AbstractActor {
// 运行中的任务需要进行超时检查
JobTimerWheel.registerWithJob(() -> new JobTimeoutCheckTask(taskExecute.getTaskBatchId(), job.getId()),
Duration.ofSeconds(job.getExecutorTimeout()));
// 加500ms是为了让尽量保证客户端自己先超时中断防止客户端上报成功但是服务端已触发超时中断
Duration.ofMillis(DateUtils.toEpochMilli(job.getExecutorTimeout()) + 500));
// JobTimerWheel.register(SyetemTaskTypeEnum.JOB.getType(), taskExecute.getTaskBatchId(),
// new JobTimeoutCheckTask(taskExecute.getTaskBatchId(), job.getId()),
@ -226,7 +227,6 @@ public class JobExecutorActor extends AbstractActor {
jobTimerTaskDTO.setJobId(taskExecuteDTO.getJobId());
jobTimerTaskDTO.setTaskBatchId(taskExecuteDTO.getTaskBatchId());
jobTimerTaskDTO.setTaskExecutorScene(JobTaskExecutorSceneEnum.AUTO_JOB.getType());
// ResidentJobTimerTask timerTask = ;
WaitStrategy waitStrategy = WaitStrategies.WaitStrategyEnum.getWaitStrategy(job.getTriggerType());
Long preTriggerAt = ResidentTaskCache.get(job.getId());