fix(任务中心): 后台任务时间排序问题

--bug=1048138 --user=王旭 【系统设置】系统-系统后台任务-下次执行时间-排序后顺序错误 https://www.tapd.cn/55049933/s/1599597
This commit is contained in:
WangXu10 2024-10-28 18:52:51 +08:00 committed by Craftsman
parent 7c6b2041ea
commit 746688eefa
1 changed files with 2 additions and 7 deletions

View File

@ -279,13 +279,8 @@ public class BaseTaskHubService {
item.setNextTime(trigerTimeMap.get(item.getResourceId()).getNextTime()); item.setNextTime(trigerTimeMap.get(item.getResourceId()).getNextTime());
item.setLastTime(trigerTimeMap.get(item.getResourceId()).getLastTime()); item.setLastTime(trigerTimeMap.get(item.getResourceId()).getLastTime());
} else { } else {
try { item.setNextTime(item.getNextTime());
CronExpression cron = new CronExpression(item.getValue()); item.setLastTime(item.getLastTime());
Date date = new Date(System.currentTimeMillis());
item.setNextTime(cron.getNextValidTimeAfter(date).getTime());
} catch (ParseException e) {
LogUtils.error(e);
}
} }
} }
} }